onoma 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +4 -0
  4. data/CODE_OF_CONDUCT.md +13 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +41 -0
  8. data/Rakefile +93 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +7 -0
  11. data/config/locales/arb.yml +5711 -0
  12. data/config/locales/eng.yml +5704 -0
  13. data/config/locales/fra.yml +5869 -0
  14. data/config/locales/jpn.yml +5713 -0
  15. data/config/locales/por.yml +5702 -0
  16. data/config/locales/spa.yml +5708 -0
  17. data/db/migrate/20150813022423_add_data.xml +5740 -0
  18. data/db/migrate/20150813224145_fix_zea.xml +14 -0
  19. data/db/migrate/20150813224155_fix_hordeum.xml +175 -0
  20. data/db/migrate/20150814104907_rename_charts_of_accounts.xml +4 -0
  21. data/db/migrate/20150817202608_rename_abaci.xml +19 -0
  22. data/db/migrate/20150818132801_add_vinifera_product_exchangers.xml +4 -0
  23. data/db/migrate/20150818152001_add_wine_bottles.xml +13 -0
  24. data/db/migrate/20150818232501_add_vinifera_sale_exchangers.xml +4 -0
  25. data/db/migrate/20150820212931_remove_abaci.xml +19 -0
  26. data/db/migrate/20150821082601_add_grain_variants.xml +4 -0
  27. data/db/migrate/20150821230800_rename_invalid_document_natures.xml +12 -0
  28. data/db/migrate/20150825180658_add_production_usages.xml +5 -0
  29. data/db/migrate/20150826091319_add_leguminous_crop.xml +11 -0
  30. data/db/migrate/20150826092813_add_cannabis_varieties.xml +51 -0
  31. data/db/migrate/20150826100013_add_thicket_varieties.xml +9 -0
  32. data/db/migrate/20150826103353_add_eis_plant.xml +31 -0
  33. data/db/migrate/20150902081701_add_garden_varieties.xml +7 -0
  34. data/db/migrate/20150905094701_add_milklic_individual_production_exchangers.xml +4 -0
  35. data/db/migrate/20150914095928_add_meteorological_analysis_nature.xml +46 -0
  36. data/db/migrate/20150916110501_add_grain_analysis.xml +5 -0
  37. data/db/migrate/20150916151652_fix_product_nature_variant_units.xml +515 -0
  38. data/db/migrate/20150919123840_fix_plant_varieties.xml +36 -0
  39. data/db/migrate/20150919223801_change_walnut_nature.xml +6 -0
  40. data/db/migrate/20150920212201_add_fruit_harvest.xml +4 -0
  41. data/db/migrate/20150921104001_add_fuel_consumption_indicator.xml +7 -0
  42. data/db/migrate/20150921110601_add_crumbs_exchangers.xml +4 -0
  43. data/db/migrate/20150921175601_add_units_liter_per_hour.xml +4 -0
  44. data/db/migrate/20151001154701_add_missing_variants.xml +9 -0
  45. data/db/migrate/20151019090110_add_json_exchange_natures.xml +11 -0
  46. data/db/migrate/20151021172901_add_missing_indicator_on_animals.xml +12 -0
  47. data/db/migrate/20151027095601_add_missing_issue_natures.xml +6 -0
  48. data/db/migrate/20151102110723_add_daily_nitrogen_production_indicator.xml +4 -0
  49. data/db/migrate/20151107122501_add_cap_statements_exchangers.xml +4 -0
  50. data/db/migrate/20151111212501_add_missing_cap_productions.xml +15 -0
  51. data/db/migrate/20151117192943_change_procedure_nomenclatures.xml +159 -0
  52. data/db/migrate/20151122101101_add_missing_tropical_cap_varieties.xml +33 -0
  53. data/db/migrate/20151125163801_add_missing_varieties.xml +7 -0
  54. data/db/migrate/20151209000401_add_missing_crop_sets.xml +12 -0
  55. data/db/migrate/20151209011801_add_missing_varieties.xml +45 -0
  56. data/db/migrate/20151209094701_add_oleaginous_missing_varieties.xml +11 -0
  57. data/db/migrate/20151209103601_add_proteaginous_missing_varieties.xml +6 -0
  58. data/db/migrate/20151210150144_add_daucus_carota_varieties.xml +38 -0
  59. data/db/migrate/20151210163440_add_phaseolus_varieties.xml +11 -0
  60. data/db/migrate/20151210164511_add_allium_porrum_varieties.xml +13 -0
  61. data/db/migrate/20151210170103_add_allium_cepa_varieties.xml +6 -0
  62. data/db/migrate/20151211114316_add_beta_varieties.xml +4 -0
  63. data/db/migrate/20151211115500_add_brassica_varieties.xml +50 -0
  64. data/db/migrate/20151211124757_add_allium_schoenoprasum_varieties.xml +4 -0
  65. data/db/migrate/20151211132045_add_cucurbita_varieties.xml +13 -0
  66. data/db/migrate/20151211143806_add_spinacia_oleracea_varieties.xml +5 -0
  67. data/db/migrate/20151211151402_add_lactuca_varieties.xml +6 -0
  68. data/db/migrate/20151211153218_add_zea_mays_varieties.xml +46 -0
  69. data/db/migrate/20151214084817_add_hordeum_varieties.xml +5 -0
  70. data/db/migrate/20151214085342_add_pastinaca_sativa_varieties.xml +4 -0
  71. data/db/migrate/20151214085721_add_pisum_sativum_varieties.xml +8 -0
  72. data/db/migrate/20151214090420_add_solanum_tuberosum_varieties.xml +4 -0
  73. data/db/migrate/20151214091020_add_raphanus_varieties.xml +8 -0
  74. data/db/migrate/20151214092727_add_glycine_max_varieties.xml +4 -0
  75. data/db/migrate/20151215132825_add_abilities.xml +7 -0
  76. data/db/migrate/20151215133320_add_equipment_variants.xml +43 -0
  77. data/db/migrate/20151215214901_add_openwheatermap_identifiers.xml +5 -0
  78. data/db/migrate/20151216095351_add_ridger_equipment_variants.xml +4 -0
  79. data/db/migrate/20151216100708_add_lifter_equipment_variants.xml +4 -0
  80. data/db/migrate/20151216160914_add_raphanus_sativus_varieties.xml +4 -0
  81. data/db/migrate/20151216182551_add_more_units.xml +7 -0
  82. data/db/migrate/20151218081701_add_crops_issue_natures.xml +11 -0
  83. data/db/migrate/20151222162657_add_varieties.xml +18 -0
  84. data/db/migrate/20151222180021_remove_population.xml +402 -0
  85. data/db/reference.xml +5727 -0
  86. data/lib/onoma/database.rb +171 -0
  87. data/lib/onoma/item.rb +272 -0
  88. data/lib/onoma/migration/actions/base.rb +19 -0
  89. data/lib/onoma/migration/actions/item_change.rb +35 -0
  90. data/lib/onoma/migration/actions/item_creation.rb +39 -0
  91. data/lib/onoma/migration/actions/item_merging.rb +19 -0
  92. data/lib/onoma/migration/actions/item_removal.rb +18 -0
  93. data/lib/onoma/migration/actions/nomenclature_change.rb +26 -0
  94. data/lib/onoma/migration/actions/nomenclature_creation.rb +24 -0
  95. data/lib/onoma/migration/actions/nomenclature_removal.rb +24 -0
  96. data/lib/onoma/migration/actions/property_creation.rb +43 -0
  97. data/lib/onoma/migration/actions.rb +9 -0
  98. data/lib/onoma/migration/base.rb +45 -0
  99. data/lib/onoma/migration.rb +11 -0
  100. data/lib/onoma/migrator/reference.rb +77 -0
  101. data/lib/onoma/migrator/translation.rb +30 -0
  102. data/lib/onoma/migrator.rb +3 -0
  103. data/lib/onoma/nomenclature.rb +507 -0
  104. data/lib/onoma/property.rb +98 -0
  105. data/lib/onoma/reference.rb +17 -0
  106. data/lib/onoma/reflection.rb +34 -0
  107. data/lib/onoma/relation.rb +9 -0
  108. data/lib/onoma/version.rb +3 -0
  109. data/lib/onoma.rb +133 -0
  110. data/onoma.gemspec +28 -0
  111. metadata +237 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0739d2e2e8d74f6b8d2a4ef92dbcec8aa3afc5a2
4
+ data.tar.gz: 0b1eb0380ca149f16a718b43907e2f914a01f645
5
+ SHA512:
6
+ metadata.gz: ee9f270e448251f8ecb40c43e23ee78b6a3982f6c72d7dd84ac398ac5d2e28611ffa8afed4d2f7d46644ada38b97f94a093ead0875b2f3e7b10fead6b3849cbb
7
+ data.tar.gz: ef9f205d71d9392e9282dac2016bacfdf7aa68fd5511337fee3aeb87daf201d883e7efbd08387bfac0e9cdbe689b3b93ae8591801930597abfb0e253e69fb643
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in nomen.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Brice TEXIER
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Onoma
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/onoma`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'onoma'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install onoma
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ekylibre/onoma. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,93 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+ require 'onoma'
4
+
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << "test"
7
+ t.libs << "lib"
8
+ t.test_files = FileList['test/**/*_test.rb']
9
+ end
10
+
11
+ task :default => :test
12
+
13
+
14
+ namespace :db do
15
+
16
+ task :list do
17
+ Onoma.all.each do |n|
18
+ if n.name.to_s.classify.tableize != n.name.to_s
19
+ puts n.name.to_s.red
20
+ else
21
+ puts n.name
22
+ end
23
+ end
24
+ end
25
+
26
+ namespace :export do
27
+ desc 'Export nomenclatures as CSV in tmp/nomenclatures'
28
+ task :csv do
29
+ output = Onoma.root.join('tmp', 'nomenclatures')
30
+ FileUtils.rm_rf(output)
31
+ FileUtils.mkdir_p(output)
32
+ Onoma.all.each do |n|
33
+ n.to_csv(output.join("#{n.name}.csv"))
34
+ end
35
+ end
36
+ end
37
+
38
+ task export: 'export:csv'
39
+
40
+ namespace :migrate do
41
+ task :generate do
42
+ unless name = ENV['NAME']
43
+ puts 'Use command with NAME: rake onoma:migrate:generate NAME=add_some_stuff'
44
+ exit 1
45
+ end
46
+ name = name.downcase.gsub(/[\s\-\_]+/, '_')
47
+ full_name = Time.zone.now.l(format: '%Y%m%d%H%M%S') + "_#{name}"
48
+ file = Onoma.root.join('db', 'migrate', "#{full_name}.xml")
49
+ found = Dir.glob(Onoma.migrations_path.join('*.xml')).detect do |file|
50
+ File.basename(file).to_s =~ /^\d+\_#{name}\.xml/
51
+ end
52
+ if found
53
+ puts "A migration with same name #{name} already exists: #{Pathname.new(found).relative_path_from(Onoma.root)}"
54
+ exit 2
55
+ end
56
+ xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
57
+ xml << "<migration name=\"#{name.humanize}\">\n"
58
+ xml << " <!-- Add your changes here -->\n"
59
+ xml << "</migration>\n"
60
+ File.write(file, xml)
61
+ puts "Create #{file.relative_path_from(Onoma.root).to_s.yellow}"
62
+ end
63
+
64
+ task :model do
65
+ Onoma.missing_migrations.each do |migration|
66
+ Onoma::Migrator::Model.run(migration)
67
+ end
68
+ end
69
+
70
+ task :translation do
71
+ Onoma.missing_migrations.each do |migration|
72
+ Onoma::Migrator::Translation.run(migration)
73
+ end
74
+ end
75
+
76
+ task :reference do
77
+ Onoma.missing_migrations.each do |migration|
78
+ Onoma::Migrator::Reference.run(migration)
79
+ end
80
+ end
81
+ end
82
+
83
+ desc 'Generate migration file (in db/migrate) for corresponding '
84
+ task migrate: 'migrate:reference'
85
+ # task :migrate do
86
+ # Onoma.missing_migrations.each do |migration|
87
+ # puts migration.name.yellow
88
+ # Onoma::Migrator::Reference.run(migration)
89
+ # Onoma::Migrator::Model.run(migration)
90
+ # Onoma::Migrator::Translation.run(migration)
91
+ # end
92
+ # end
93
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "nomen"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here