From b6e3b059b45157c8506fe974d967f88e166afd96 Mon Sep 17 00:00:00 2001 From: Luciano Prestes Cavalcanti Date: Wed, 25 Nov 2015 18:17:03 +0100 Subject: [PATCH] software-communities: refactoring namespaces --- src/noosfero-spb/software_communities/db/migrate/20140528193902_create_license_infos_table.rb | 3 --- src/noosfero-spb/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb | 2 -- src/noosfero-spb/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb | 3 --- src/noosfero-spb/software_communities/db/migrate/20140714133901_create_operating_name_table.rb | 3 --- src/noosfero-spb/software_communities/db/migrate/20150210182519_rename_cc_license.rb | 13 ------------- src/noosfero-spb/software_communities/db/migrate/20151125170753_rename_cc_license.rb | 18 ++++++++++++++++++ src/noosfero-spb/software_communities/db/migrate/20151125171258_create_basic_infos.rb | 17 +++++++++++++++++ 7 files changed, 35 insertions(+), 24 deletions(-) delete mode 100644 src/noosfero-spb/software_communities/db/migrate/20150210182519_rename_cc_license.rb create mode 100644 src/noosfero-spb/software_communities/db/migrate/20151125170753_rename_cc_license.rb create mode 100644 src/noosfero-spb/software_communities/db/migrate/20151125171258_create_basic_infos.rb diff --git a/src/noosfero-spb/software_communities/db/migrate/20140528193902_create_license_infos_table.rb b/src/noosfero-spb/software_communities/db/migrate/20140528193902_create_license_infos_table.rb index 0024f7d..e76a74b 100644 --- a/src/noosfero-spb/software_communities/db/migrate/20140528193902_create_license_infos_table.rb +++ b/src/noosfero-spb/software_communities/db/migrate/20140528193902_create_license_infos_table.rb @@ -4,9 +4,6 @@ class CreateLicenseInfosTable < ActiveRecord::Migration t.string :version t.string :link end - - link = "http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" - LicenseInfo.create(:version => "CC-GPL-V2", :link => link) end def self.down diff --git a/src/noosfero-spb/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb b/src/noosfero-spb/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb index 2c939eb..d81a50d 100644 --- a/src/noosfero-spb/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb +++ b/src/noosfero-spb/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb @@ -3,8 +3,6 @@ class CreateProgrammingLanguagesTable < ActiveRecord::Migration create_table :programming_languages do |t| t.string :name end - - SoftwareHelper.create_list_with_file("plugins/software_communities/public/static/languages.txt", ProgrammingLanguage) end def self.down diff --git a/src/noosfero-spb/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb b/src/noosfero-spb/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb index af2dda7..f564bc4 100644 --- a/src/noosfero-spb/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb +++ b/src/noosfero-spb/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb @@ -3,9 +3,6 @@ class CreateDatabaseDescriptionsTable < ActiveRecord::Migration create_table :database_descriptions do |t| t.string :name end - - path_to_file = "plugins/software_communities/public/static/databases.txt" - SoftwareHelper.create_list_with_file(path_to_file, DatabaseDescription) end def self.down diff --git a/src/noosfero-spb/software_communities/db/migrate/20140714133901_create_operating_name_table.rb b/src/noosfero-spb/software_communities/db/migrate/20140714133901_create_operating_name_table.rb index 610bcec..d935f2d 100644 --- a/src/noosfero-spb/software_communities/db/migrate/20140714133901_create_operating_name_table.rb +++ b/src/noosfero-spb/software_communities/db/migrate/20140714133901_create_operating_name_table.rb @@ -3,9 +3,6 @@ class CreateOperatingNameTable < ActiveRecord::Migration create_table :operating_system_names do |t| t.string :name end - - path_to_file = "plugins/software_communities/public/static/operating_systems.txt" - SoftwareHelper.create_list_with_file(path_to_file, OperatingSystemName) end def down diff --git a/src/noosfero-spb/software_communities/db/migrate/20150210182519_rename_cc_license.rb b/src/noosfero-spb/software_communities/db/migrate/20150210182519_rename_cc_license.rb deleted file mode 100644 index 9cc7fc8..0000000 --- a/src/noosfero-spb/software_communities/db/migrate/20150210182519_rename_cc_license.rb +++ /dev/null @@ -1,13 +0,0 @@ -class RenameCcLicense < ActiveRecord::Migration - def up - license = LicenseInfo.find_by_version "CC-GPL-V2" - license.version = "Creative Commons GPL V2" - license.save! - end - - def down - license = LicenseInfo.find_by_version "Creative Commons GPL V2" - license.version = "CC-GPL-V2" - license.save! - end -end diff --git a/src/noosfero-spb/software_communities/db/migrate/20151125170753_rename_cc_license.rb b/src/noosfero-spb/software_communities/db/migrate/20151125170753_rename_cc_license.rb new file mode 100644 index 0000000..e3ff788 --- /dev/null +++ b/src/noosfero-spb/software_communities/db/migrate/20151125170753_rename_cc_license.rb @@ -0,0 +1,18 @@ +class RenameCcLicense < ActiveRecord::Migration + def up + license = SoftwareCommunitiesPlugin::LicenseInfo.find_by_version "CC-GPL-V2" + unless license.nil? + license.version = "Creative Commons GPL V2" + license.save! + end + end + + def down + license = SoftwareCommunitiesPlugin::LicenseInfo.find_by_version "Creative Commons GPL V2" + unless license.nil? + license.version = "CC-GPL-V2" + license.save! + end + end +end + diff --git a/src/noosfero-spb/software_communities/db/migrate/20151125171258_create_basic_infos.rb b/src/noosfero-spb/software_communities/db/migrate/20151125171258_create_basic_infos.rb new file mode 100644 index 0000000..2e35505 --- /dev/null +++ b/src/noosfero-spb/software_communities/db/migrate/20151125171258_create_basic_infos.rb @@ -0,0 +1,17 @@ +class CreateBasicInfos < ActiveRecord::Migration + def up + link = "http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" + SoftwareCommunitiesPlugin::LicenseInfo.create(:version => "CC-GPL-V2", :link => link) + + SoftwareCommunitiesPlugin::SoftwareHelper.create_list_with_file("plugins/software_communities/public/static/languages.txt", SoftwareCommunitiesPlugin::ProgrammingLanguage) + + path_to_file = "plugins/software_communities/public/static/databases.txt" + SoftwareCommunitiesPlugin::SoftwareHelper.create_list_with_file(path_to_file, SoftwareCommunitiesPlugin::DatabaseDescription) + + path_to_file = "plugins/software_communities/public/static/operating_systems.txt" + SoftwareCommunitiesPlugin::SoftwareHelper.create_list_with_file(path_to_file, SoftwareCommunitiesPlugin::OperatingSystemName) + end + + def down + end +end -- libgit2 0.21.2