refinerycms-core 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/app/assets/javascripts/refinery/admin.js.erb +3 -0
  2. data/app/assets/javascripts/wymeditor/functions.js.erb +1 -1
  3. data/app/assets/javascripts/wymeditor/lang/{zh_cn.js → zh-CN.js} +1 -1
  4. data/app/assets/javascripts/wymeditor/prototypes.js.erb +1 -1
  5. data/app/assets/stylesheets/refinery/layout.css.scss +26 -0
  6. data/app/views/refinery/admin/_image_picker.html.erb +1 -1
  7. data/app/views/refinery/admin/_resource_picker.html.erb +19 -21
  8. data/config/locales/es.yml +2 -2
  9. data/config/locales/fr.yml +9 -1
  10. data/lib/generators/refinery/cms/cms_generator.rb +6 -4
  11. data/lib/generators/refinery/core/templates/config/initializers/refinery/core.rb.erb +1 -0
  12. data/lib/generators/refinery/engine/engine_generator.rb +9 -3
  13. data/lib/generators/refinery/engine/templates/Gemfile +1 -0
  14. data/lib/generators/refinery/engine/templates/config/locales/zh-CN.yml +30 -0
  15. data/lib/generators/refinery/form/form_generator.rb +11 -7
  16. data/lib/generators/refinery/form/templates/config/locales/da.yml +60 -63
  17. data/lib/generators/refinery/form/templates/config/locales/de.yml +68 -68
  18. data/lib/generators/refinery/form/templates/config/locales/es.yml +60 -64
  19. data/lib/generators/refinery/form/templates/config/locales/fr.yml +68 -68
  20. data/lib/generators/refinery/form/templates/config/locales/it.yml +60 -62
  21. data/lib/generators/refinery/form/templates/config/locales/lv.yml +67 -67
  22. data/lib/generators/refinery/form/templates/config/locales/nb.yml +68 -71
  23. data/lib/generators/refinery/form/templates/config/locales/nl.yml +65 -64
  24. data/lib/generators/refinery/form/templates/config/locales/pt-BR.yml +68 -68
  25. data/lib/generators/refinery/form/templates/config/locales/ru.yml +70 -73
  26. data/lib/generators/refinery/form/templates/config/locales/sl.yml +61 -63
  27. data/lib/generators/refinery/form/templates/config/locales/zh-CN.yml +77 -3
  28. data/lib/refinery/application_controller.rb +1 -1
  29. data/lib/refinery/cli.rb +1 -1
  30. data/lib/refinery/core/engine.rb +2 -1
  31. data/lib/refinery/crud.rb +1 -1
  32. data/lib/refinery/extension_generation.rb +26 -14
  33. data/lib/refinery/version.rb +1 -1
  34. data/refinerycms-core.gemspec +1 -1
  35. data/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb +51 -0
  36. data/spec/lib/generators/refinery/engine/engine_generator_sanity_check_spec.rb +47 -0
  37. data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +0 -12
  38. data/spec/lib/refinery/crud_spec.rb +2 -2
  39. metadata +11 -8
@@ -2,7 +2,7 @@ module Refinery
2
2
  class Version
3
3
  @major = 2
4
4
  @minor = 0
5
- @tiny = 8
5
+ @tiny = 9
6
6
  @build = nil
7
7
 
8
8
  class << self
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.email = %q{info@refinerycms.com}
14
14
  s.homepage = %q{http://refinerycms.com}
15
15
  s.rubyforge_project = %q{refinerycms}
16
- s.authors = ['Philip Arndt', 'Uģis Ozols', 'Rob Yurkowski', 'David Jones', 'Steven Heidel']
16
+ s.authors = ['Philip Arndt', 'Uģis Ozols', 'Rob Yurkowski']
17
17
  s.license = %q{MIT}
18
18
  s.require_paths = %w(lib)
19
19
 
@@ -0,0 +1,51 @@
1
+ require 'spec_helper'
2
+ require 'generator_spec/test_case'
3
+ require 'generators/refinery/engine/engine_generator'
4
+
5
+ module Refinery
6
+ describe EngineGenerator do
7
+ include GeneratorSpec::TestCase
8
+ destination File.expand_path("../../../../../../tmp", __FILE__)
9
+
10
+ before do
11
+ prepare_destination
12
+ run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource }
13
+ end
14
+
15
+ context "when generating a resource inside existing extensions dir" do
16
+
17
+ before do
18
+ run_generator %w{ rspec_item_test title:string --extension rspec_product_tests --namespace rspec_product_tests --skip }
19
+ end
20
+
21
+ it "creates a new migration with the new resource" do
22
+ destination_root.should have_structure {
23
+ directory "vendor" do
24
+ directory "extensions" do
25
+ directory "rspec_product_tests" do
26
+ directory "db" do
27
+ directory "migrate" do
28
+ file "2_create_rspec_product_tests_rspec_item_tests.rb"
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ }
35
+ end
36
+
37
+ it "appends existing seeds file" do
38
+ File.open("#{destination_root}/vendor/extensions/rspec_product_tests/db/seeds.rb") do |file|
39
+ file.grep(%r{/rspec_product_tests|/rspec_item_tests}).count.should eq(2)
40
+ end
41
+ end
42
+
43
+ it "appends routes to the routes file" do
44
+ File.open("#{destination_root}/vendor/extensions/rspec_product_tests/config/routes.rb") do |file|
45
+ file.grep(%r{rspec_item_tests}).count.should eq(2)
46
+ end
47
+ end
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+ require 'generator_spec/test_case'
3
+ require 'generators/refinery/engine/engine_generator'
4
+
5
+ module Refinery
6
+ describe EngineGenerator do
7
+ include GeneratorSpec::TestCase
8
+
9
+ it "exits when reserved word is used for extnesion name" do
10
+ clash_keywords = YAML.load_file(File.expand_path("../../../../../../lib/generators/refinery/clash_keywords.yml", __FILE__))
11
+ clash_keywords.each do |word|
12
+ lambda {
13
+ STDERR.should_receive(:puts).with("\nPlease choose a different name. The generated code would fail for class '#{word}' as it conflicts with a reserved keyword.\n\n")
14
+ run_generator [word, "title:string"]
15
+ }.should raise_error(SystemExit)
16
+ end
17
+ end
18
+
19
+ it "exits when plural word is used for extension name" do
20
+ lambda {
21
+ STDERR.should_receive(:puts).with("\nPlease specify the singular name 'apple' instead of 'apples'.\n\n")
22
+ run_generator %w{ apples title:string }
23
+ }.should raise_error(SystemExit)
24
+ end
25
+
26
+ it "exits when uncountable word is used for extension name" do
27
+ lambda {
28
+ STDERR.should_receive(:puts).with("\nThe extension name you specified will not work as the singular name is equal to the plural name.\n\n")
29
+ run_generator %w{ money title:string }
30
+ }.should raise_error(SystemExit)
31
+ end
32
+
33
+ it "exits when no attribute provided" do
34
+ lambda {
35
+ STDERR.should_receive(:puts).with("\nYou must specify a name and at least one field.\nFor help, run: rails generate refinery:engine\n\n")
36
+ run_generator %w{ car }
37
+ }.should raise_error(SystemExit)
38
+ end
39
+
40
+ it "exits when '--extension' option is used but there is no extension by provided name" do
41
+ lambda {
42
+ STDERR.should_receive(:puts).with("\nYou can't use '--extension nonexistent' option because extension with name nonexistent doesn't exist.\n\n")
43
+ run_generator %w{ car title:string --extension nonexistent }
44
+ }.should raise_error(SystemExit)
45
+ end
46
+ end
47
+ end
@@ -81,18 +81,6 @@ module Refinery
81
81
  }
82
82
  end
83
83
 
84
- context "when generating extension inside existing extensions dir" do
85
- before do
86
- run_generator %w{ rspec_item_test title:string --extension rspec_product_tests --skip }
87
- end
88
-
89
- it "appends existing seeds file" do
90
- File.open("#{destination_root}/vendor/extensions/rspec_product_tests/db/seeds.rb") do |file|
91
- file.grep(%r{/rspec_product_tests|/rspec_item_tests}).count.should eq(2)
92
- end
93
- end
94
- end
95
-
96
84
  describe "attr_accessible" do
97
85
  it "adds attributes to the list" do
98
86
  File.open("#{destination_root}/vendor/extensions/rspec_product_tests/app/models/refinery/rspec_product_tests/rspec_product_test.rb") do |file|
@@ -101,11 +101,11 @@ module Refinery
101
101
  dummy.rgt.should eq(10)
102
102
  end
103
103
 
104
- # Regression test for https://github.com/resolve/refinerycms/issues/1585
104
+ # Regression test for https://github.com/refinery/refinerycms/issues/1585
105
105
  it "sorts numerically rather than by string key" do
106
106
  dummy, dummy_params = [], {}
107
107
 
108
- # When we have 11 entries, the 11th index will be #10, which will be
108
+ # When we have 11 entries, the 11th index will be #10, which will be
109
109
  # sorted above #2 if we are sorting by strings.
110
110
  11.times do |n|
111
111
  dummy << Refinery::CrudDummy.create!
metadata CHANGED
@@ -1,19 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Philip Arndt
9
9
  - Uģis Ozols
10
10
  - Rob Yurkowski
11
- - David Jones
12
- - Steven Heidel
13
11
  autorequire:
14
12
  bindir: bin
15
13
  cert_chain: []
16
- date: 2012-08-18 00:00:00.000000000 Z
14
+ date: 2012-11-21 00:00:00.000000000 Z
17
15
  dependencies:
18
16
  - !ruby/object:Gem::Dependency
19
17
  name: acts_as_indexed
@@ -413,7 +411,7 @@ files:
413
411
  - app/assets/javascripts/wymeditor/lang/sv.js
414
412
  - app/assets/javascripts/wymeditor/lang/tr.js
415
413
  - app/assets/javascripts/wymeditor/lang/vi.js
416
- - app/assets/javascripts/wymeditor/lang/zh_cn.js
414
+ - app/assets/javascripts/wymeditor/lang/zh-CN.js
417
415
  - app/assets/javascripts/wymeditor/prototypes.js.erb
418
416
  - app/assets/javascripts/wymeditor/setup.js.erb
419
417
  - app/assets/javascripts/wymeditor/skins/refinery/skin.js
@@ -558,6 +556,7 @@ files:
558
556
  - lib/generators/refinery/engine/templates/config/locales/nb.yml
559
557
  - lib/generators/refinery/engine/templates/config/locales/nl.yml
560
558
  - lib/generators/refinery/engine/templates/config/locales/sk.yml
559
+ - lib/generators/refinery/engine/templates/config/locales/zh-CN.yml
561
560
  - lib/generators/refinery/engine/templates/config/routes.rb.erb
562
561
  - lib/generators/refinery/engine/templates/db/migrate/1_create_namespace_plural_name.rb.erb
563
562
  - lib/generators/refinery/engine/templates/db/seeds.rb.erb
@@ -665,6 +664,8 @@ files:
665
664
  - spec/helpers/refinery/translation_helper_spec.rb
666
665
  - spec/lib/generators/refinery/cms/cms_generator_spec.rb
667
666
  - spec/lib/generators/refinery/core/core_generator_spec.rb
667
+ - spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb
668
+ - spec/lib/generators/refinery/engine/engine_generator_sanity_check_spec.rb
668
669
  - spec/lib/generators/refinery/engine/engine_generator_spec.rb
669
670
  - spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb
670
671
  - spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb
@@ -702,7 +703,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
702
703
  version: '0'
703
704
  segments:
704
705
  - 0
705
- hash: 4442210151726982447
706
+ hash: 4391565474515124907
706
707
  required_rubygems_version: !ruby/object:Gem::Requirement
707
708
  none: false
708
709
  requirements:
@@ -711,10 +712,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
711
712
  version: '0'
712
713
  segments:
713
714
  - 0
714
- hash: 4442210151726982447
715
+ hash: 4391565474515124907
715
716
  requirements: []
716
717
  rubyforge_project: refinerycms
717
- rubygems_version: 1.8.22
718
+ rubygems_version: 1.8.24
718
719
  signing_key:
719
720
  specification_version: 3
720
721
  summary: Core extension for Refinery CMS
@@ -729,6 +730,8 @@ test_files:
729
730
  - spec/helpers/refinery/translation_helper_spec.rb
730
731
  - spec/lib/generators/refinery/cms/cms_generator_spec.rb
731
732
  - spec/lib/generators/refinery/core/core_generator_spec.rb
733
+ - spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb
734
+ - spec/lib/generators/refinery/engine/engine_generator_sanity_check_spec.rb
732
735
  - spec/lib/generators/refinery/engine/engine_generator_spec.rb
733
736
  - spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb
734
737
  - spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb