Commit e0b0cbde246d50edfdc0f4d7445c55dc758bb067
Committed by
David Silva
1 parent
57ae8cf1
Exists in
master
and in
5 other branches
Remove trailing whitespace
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Signed-off-by: Parley Martins <parley@outlook.com>
Showing
15 changed files
with
29 additions
and
34 deletions
Show diff stats
db/migrate/20140528193905_create_software_infos_table.rb
@@ -3,11 +3,11 @@ class CreateSoftwareInfosTable < ActiveRecord::Migration | @@ -3,11 +3,11 @@ class CreateSoftwareInfosTable < ActiveRecord::Migration | ||
3 | create_table :software_infos do |t| | 3 | create_table :software_infos do |t| |
4 | t.references :license_info | 4 | t.references :license_info |
5 | t.references :community | 5 | t.references :community |
6 | - t.boolean :e_mag, :default => false | ||
7 | - t.boolean :icp_brasil,:default => false | ||
8 | - t.boolean :intern, :default => false | ||
9 | - t.boolean :e_ping, :default => false | ||
10 | - t.boolean :e_arq, :default => false | 6 | + t.boolean :e_mag, :default => false |
7 | + t.boolean :icp_brasil,:default => false | ||
8 | + t.boolean :intern, :default => false | ||
9 | + t.boolean :e_ping, :default => false | ||
10 | + t.boolean :e_arq, :default => false | ||
11 | t.string :name, :default => ' ' | 11 | t.string :name, :default => ' ' |
12 | t.string :operating_platform | 12 | t.string :operating_platform |
13 | t.string :demonstration_url | 13 | t.string :demonstration_url |
db/migrate/20140812143218_remove_field_role_from_user.rb
1 | class RemoveFieldRoleFromUser < ActiveRecord::Migration | 1 | class RemoveFieldRoleFromUser < ActiveRecord::Migration |
2 | def up | 2 | def up |
3 | change_table :users do |t| | 3 | change_table :users do |t| |
4 | - t.remove :role | 4 | + t.remove :role |
5 | end | 5 | end |
6 | end | 6 | end |
7 | 7 | ||
8 | def down | 8 | def down |
9 | change_table :users do |t| | 9 | change_table :users do |t| |
10 | - t.string :role | 10 | + t.string :role |
11 | end | 11 | end |
12 | end | 12 | end |
13 | end | 13 | end |
db/migrate/20140814125947_add_new_fields_to_public_institution.rb
@@ -6,6 +6,6 @@ class AddNewFieldsToPublicInstitution < ActiveRecord::Migration | @@ -6,6 +6,6 @@ class AddNewFieldsToPublicInstitution < ActiveRecord::Migration | ||
6 | 6 | ||
7 | def down | 7 | def down |
8 | remove_column :institutions, :sisp | 8 | remove_column :institutions, :sisp |
9 | - add_column :institutions, :juridical_nature, :string | 9 | + add_column :institutions, :juridical_nature, :string |
10 | end | 10 | end |
11 | end | 11 | end |
db/migrate/20140814131606_create_juridical_natures_table.rb
@@ -3,11 +3,10 @@ class CreateJuridicalNaturesTable < ActiveRecord::Migration | @@ -3,11 +3,10 @@ class CreateJuridicalNaturesTable < ActiveRecord::Migration | ||
3 | create_table :juridical_natures do |t| | 3 | create_table :juridical_natures do |t| |
4 | t.string :name | 4 | t.string :name |
5 | end | 5 | end |
6 | - | ||
7 | SoftwareHelper.create_list_with_file("plugins/mpog_software/public/static/juridical_nature.txt", JuridicalNature) | 6 | SoftwareHelper.create_list_with_file("plugins/mpog_software/public/static/juridical_nature.txt", JuridicalNature) |
8 | end | 7 | end |
9 | 8 | ||
10 | def down | 9 | def down |
11 | - drop_table :juridical_natures | 10 | + drop_table :juridical_natures |
12 | end | 11 | end |
13 | end | 12 | end |
db/migrate/20141007140419_add_finality_field_to_software_table.rb
1 | class AddFinalityFieldToSoftwareTable < ActiveRecord::Migration | 1 | class AddFinalityFieldToSoftwareTable < ActiveRecord::Migration |
2 | def up | 2 | def up |
3 | add_column :software_infos, :finality, :string, :limit => 140 | 3 | add_column :software_infos, :finality, :string, :limit => 140 |
4 | - | ||
5 | end | 4 | end |
6 | 5 | ||
7 | def down | 6 | def down |
lib/ext/user.rb
@@ -18,9 +18,9 @@ class User | @@ -18,9 +18,9 @@ class User | ||
18 | def email_has_already_been_used? | 18 | def email_has_already_been_used? |
19 | user_already_saved = User.find(:first, :conditions=>["email = ?", self.email]) | 19 | user_already_saved = User.find(:first, :conditions=>["email = ?", self.email]) |
20 | 20 | ||
21 | - if user_already_saved.nil? | 21 | + if user_already_saved.nil? |
22 | primary_email_hasnt_been_used = User.primary_or_secondary_email_already_used?(self.email).empty? | 22 | primary_email_hasnt_been_used = User.primary_or_secondary_email_already_used?(self.email).empty? |
23 | - if !self.secondary_email.nil? and self.secondary_email.empty? | 23 | + if !self.secondary_email.nil? and self.secondary_email.empty? |
24 | self.secondary_email = nil | 24 | self.secondary_email = nil |
25 | end | 25 | end |
26 | secondary_email_hasnt_been_used = User.primary_or_secondary_email_already_used?(self.secondary_email).empty? | 26 | secondary_email_hasnt_been_used = User.primary_or_secondary_email_already_used?(self.secondary_email).empty? |
lib/institution.rb
@@ -13,8 +13,8 @@ class Institution < ActiveRecord::Base | @@ -13,8 +13,8 @@ class Institution < ActiveRecord::Base | ||
13 | 13 | ||
14 | has_and_belongs_to_many :users | 14 | has_and_belongs_to_many :users |
15 | 15 | ||
16 | - attr_accessible :name, :acronym, :unit_code, :parent_code, :unit_type, | ||
17 | - :sub_juridical_nature, :normalization_level, | 16 | + attr_accessible :name, :acronym, :unit_code, :parent_code, :unit_type, |
17 | + :sub_juridical_nature, :normalization_level, | ||
18 | :version, :cnpj, :type, :governmental_power, :governmental_sphere, | 18 | :version, :cnpj, :type, :governmental_power, :governmental_sphere, |
19 | :sisp, :juridical_nature, :corporate_name | 19 | :sisp, :juridical_nature, :corporate_name |
20 | 20 | ||
@@ -25,7 +25,7 @@ class Institution < ActiveRecord::Base | @@ -25,7 +25,7 @@ class Institution < ActiveRecord::Base | ||
25 | before_save :verify_institution_type | 25 | before_save :verify_institution_type |
26 | 26 | ||
27 | belongs_to :community | 27 | belongs_to :community |
28 | - | 28 | + |
29 | scope :search_institution, lambda{ |value| | 29 | scope :search_institution, lambda{ |value| |
30 | where("name ilike ? OR acronym ilike ?", "%#{value}%", "%#{value}%" ) | 30 | where("name ilike ? OR acronym ilike ?", "%#{value}%", "%#{value}%" ) |
31 | } | 31 | } |
lib/operating_system_helper.rb
@@ -35,8 +35,8 @@ module OperatingSystemHelper | @@ -35,8 +35,8 @@ module OperatingSystemHelper | ||
35 | lambdas_list = [] | 35 | lambdas_list = [] |
36 | 36 | ||
37 | if not show_information | 37 | if not show_information |
38 | - return operating_system_html_structure({:operating_system_name_id => "", :version => ""}, have_delete_button) if list_operating_system.nil? | ||
39 | - | 38 | + return operating_system_html_structure({:operating_system_name_id => "", :version => ""}, have_delete_button) if list_operating_system.nil? |
39 | + | ||
40 | list_operating_system.each do |operating_system| | 40 | list_operating_system.each do |operating_system| |
41 | lambdas_list << operating_system_html_structure(operating_system,have_delete_button) | 41 | lambdas_list << operating_system_html_structure(operating_system,have_delete_button) |
42 | end | 42 | end |
lib/public_institution.rb
@@ -3,6 +3,4 @@ class PublicInstitution < Institution | @@ -3,6 +3,4 @@ class PublicInstitution < Institution | ||
3 | validates :acronym, :allow_blank => true, :allow_nil => true, :uniqueness=>true | 3 | validates :acronym, :allow_blank => true, :allow_nil => true, :uniqueness=>true |
4 | validates :cnpj, :uniqueness=>true | 4 | validates :cnpj, :uniqueness=>true |
5 | validates_format_of :cnpj, :with => /^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/, :allow_nil => true, :allow_blank => true | 5 | validates_format_of :cnpj, :with => /^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/, :allow_nil => true, :allow_blank => true |
6 | - | ||
7 | - | ||
8 | end | 6 | end |
lib/search_catalog_block.rb
@@ -10,7 +10,6 @@ class SearchCatalogBlock < Block | @@ -10,7 +10,6 @@ class SearchCatalogBlock < Block | ||
10 | 10 | ||
11 | def help | 11 | def help |
12 | _('This block displays the search categories field ') | 12 | _('This block displays the search categories field ') |
13 | - | ||
14 | end | 13 | end |
15 | 14 | ||
16 | def content(args={}) | 15 | def content(args={}) |
lib/software_language.rb
1 | class SoftwareLanguage < ActiveRecord::Base | 1 | class SoftwareLanguage < ActiveRecord::Base |
2 | attr_accessible :version, :operating_system | 2 | attr_accessible :version, :operating_system |
3 | - | 3 | + |
4 | belongs_to :software_info | 4 | belongs_to :software_info |
5 | belongs_to :programming_language | 5 | belongs_to :programming_language |
6 | 6 |
lib/software_language_helper.rb
@@ -45,7 +45,7 @@ module SoftwareLanguageHelper | @@ -45,7 +45,7 @@ module SoftwareLanguageHelper | ||
45 | ActionView::Helpers::FormOptionsHelper, | 45 | ActionView::Helpers::FormOptionsHelper, |
46 | ApplicationHelper | 46 | ApplicationHelper |
47 | ) | 47 | ) |
48 | - | 48 | + |
49 | lambdas_list = [] | 49 | lambdas_list = [] |
50 | 50 | ||
51 | if not show_information | 51 | if not show_information |
@@ -55,7 +55,7 @@ module SoftwareLanguageHelper | @@ -55,7 +55,7 @@ module SoftwareLanguageHelper | ||
55 | lambdas_list << language_html_structure(language) | 55 | lambdas_list << language_html_structure(language) |
56 | end | 56 | end |
57 | 57 | ||
58 | - else | 58 | + else |
59 | list_languages.each do |language| | 59 | list_languages.each do |language| |
60 | lambdas_list << language_html_show_structure(language) | 60 | lambdas_list << language_html_show_structure(language) |
61 | end | 61 | end |
test/unit/governmental_power_test.rb
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' | @@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | require File.dirname(__FILE__) + '/../helpers/institution_test_helper' | 2 | require File.dirname(__FILE__) + '/../helpers/institution_test_helper' |
3 | 3 | ||
4 | class GovernmentalPowerTest < ActiveSupport::TestCase | 4 | class GovernmentalPowerTest < ActiveSupport::TestCase |
5 | - | 5 | + |
6 | def setup | 6 | def setup |
7 | @gov_sphere = GovernmentalSphere.create(:name=>"Some Gov Sphere") | 7 | @gov_sphere = GovernmentalSphere.create(:name=>"Some Gov Sphere") |
8 | @juridical_nature = JuridicalNature.create(:name => "Autarquia") | 8 | @juridical_nature = JuridicalNature.create(:name => "Autarquia") |
test/unit/software_database_test.rb
@@ -13,31 +13,31 @@ class SoftwareDatabaseTest < ActiveSupport::TestCase | @@ -13,31 +13,31 @@ class SoftwareDatabaseTest < ActiveSupport::TestCase | ||
13 | end | 13 | end |
14 | 14 | ||
15 | should "save if all informations of @software_database are filled" do | 15 | should "save if all informations of @software_database are filled" do |
16 | - assert @software_database.save, "Database should have been saved" | 16 | + assert @software_database.save, "Database should have been saved" |
17 | end | 17 | end |
18 | - | 18 | + |
19 | should "not save if database description id is empty" do | 19 | should "not save if database description id is empty" do |
20 | @software_database.database_description_id = nil | 20 | @software_database.database_description_id = nil |
21 | - assert !@software_database.save, "Database description must be filled" | 21 | + assert !@software_database.save, "Database description must be filled" |
22 | end | 22 | end |
23 | 23 | ||
24 | should "not save if version is empty" do | 24 | should "not save if version is empty" do |
25 | @software_database.version = nil | 25 | @software_database.version = nil |
26 | - assert !@software_database.save, "Version must be filled" | 26 | + assert !@software_database.save, "Version must be filled" |
27 | end | 27 | end |
28 | 28 | ||
29 | should "not save if version has more than 20 characters" do | 29 | should "not save if version has more than 20 characters" do |
30 | @software_database.version = "a"*21 | 30 | @software_database.version = "a"*21 |
31 | - assert !@software_database.save, "Version must have until 20 characters" | 31 | + assert !@software_database.save, "Version must have until 20 characters" |
32 | end | 32 | end |
33 | 33 | ||
34 | should "not save if operating system is empty" do | 34 | should "not save if operating system is empty" do |
35 | @software_database.operating_system = nil | 35 | @software_database.operating_system = nil |
36 | - assert !@software_database.save, "Operating system must be filled" | 36 | + assert !@software_database.save, "Operating system must be filled" |
37 | end | 37 | end |
38 | - | 38 | + |
39 | should "not save if operating system has more than 20 characters" do | 39 | should "not save if operating system has more than 20 characters" do |
40 | @software_database.operating_system = "a"*21 | 40 | @software_database.operating_system = "a"*21 |
41 | - assert !@software_database.save, "Operating system must have until 20 characters" | 41 | + assert !@software_database.save, "Operating system must have until 20 characters" |
42 | end | 42 | end |
43 | end | 43 | end |
test/unit/software_language_validation.rb
@@ -67,7 +67,7 @@ class SoftwareLanguageValidationTest < ActiveSupport::TestCase | @@ -67,7 +67,7 @@ class SoftwareLanguageValidationTest < ActiveSupport::TestCase | ||
67 | software_info.intern = true | 67 | software_info.intern = true |
68 | software_info.e_ping = true | 68 | software_info.e_ping = true |
69 | software_info.e_arq = true | 69 | software_info.e_arq = true |
70 | - software_info.operating_platform = 'GNU/Linux' | 70 | + software_info.operating_platform = 'GNU/Linux' |
71 | software_info.features = "Do a lot of things" | 71 | software_info.features = "Do a lot of things" |
72 | software_info.objectives = "All tests should pass !" | 72 | software_info.objectives = "All tests should pass !" |
73 | software_info | 73 | software_info |