padrino-gen 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +1 -1
  3. data/lib/padrino-gen.rb +0 -1
  4. data/lib/padrino-gen/generators/app.rb +22 -14
  5. data/lib/padrino-gen/generators/app/app.rb.tt +0 -1
  6. data/lib/padrino-gen/generators/cli.rb +1 -2
  7. data/lib/padrino-gen/generators/components/actions.rb +1 -1
  8. data/lib/padrino-gen/generators/components/mocks/rr.rb +2 -2
  9. data/lib/padrino-gen/generators/components/orms/activerecord.rb +3 -0
  10. data/lib/padrino-gen/generators/components/orms/datamapper.rb +21 -0
  11. data/lib/padrino-gen/generators/components/orms/dynamoid.rb +67 -0
  12. data/lib/padrino-gen/generators/components/orms/minirecord.rb +3 -0
  13. data/lib/padrino-gen/generators/components/tests/cucumber.rb +1 -1
  14. data/lib/padrino-gen/generators/components/tests/minitest.rb +1 -1
  15. data/lib/padrino-gen/generators/components/tests/rspec.rb +4 -4
  16. data/lib/padrino-gen/generators/model.rb +73 -29
  17. data/lib/padrino-gen/generators/project.rb +7 -3
  18. data/lib/padrino-gen/generators/project/config/apps.rb.tt +0 -1
  19. data/lib/padrino-gen/generators/templates/Gemfile.tt +1 -1
  20. data/lib/padrino-gen/padrino-tasks/activerecord.rb +43 -39
  21. data/lib/padrino-gen/padrino-tasks/database.rb +2 -1
  22. data/lib/padrino-gen/padrino-tasks/sql-helpers.rb +24 -16
  23. data/test/helper.rb +4 -3
  24. data/test/test_app_generator.rb +13 -13
  25. data/test/test_cli.rb +4 -4
  26. data/test/test_component_generator.rb +18 -18
  27. data/test/test_controller_generator.rb +26 -26
  28. data/test/test_generator.rb +2 -3
  29. data/test/test_mailer_generator.rb +10 -10
  30. data/test/test_migration_generator.rb +42 -27
  31. data/test/test_model_generator.rb +95 -74
  32. data/test/test_plugin_generator.rb +23 -23
  33. data/test/test_project_generator.rb +100 -83
  34. data/test/test_task_generator.rb +7 -7
  35. metadata +9 -8
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
 
3
3
  describe "TaskGenerator" do
4
4
  def setup
5
- @apptmp = "#{Dir.tmpdir}/padrino-tests/#{UUID.new.generate}"
5
+ @apptmp = "#{Dir.tmpdir}/padrino-tests/#{SecureRandom.hex}"
6
6
  `mkdir -p #{@apptmp}`
7
7
  end
8
8
 
@@ -10,20 +10,20 @@ describe "TaskGenerator" do
10
10
  `rm -rf #{@apptmp}`
11
11
  end
12
12
 
13
- context 'the task generator' do
14
- should "fail outside app root" do
13
+ describe 'the task generator' do
14
+ it 'should fail outside app root' do
15
15
  out, err = capture_io { generate(:task, 'foo', "-r=#{@apptmp}") }
16
16
  assert_match(/not at the root/, out)
17
17
  assert_no_file_exists('/tmp/tasks/foo.rake')
18
18
  end
19
19
 
20
- should "generate filename properly" do
20
+ it 'should generate filename properly' do
21
21
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}") }
22
22
  capture_io { generate(:task, 'DemoTask', "--namespace=Sample", "--description='This is a sample'", "-r=#{@apptmp}/sample_project") }
23
23
  assert_file_exists("#{@apptmp}/sample_project/tasks/sample_demo_task.rake")
24
24
  end
25
25
 
26
- should "generate task file with description" do
26
+ it 'should generate task file with description' do
27
27
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}") }
28
28
  capture_io { generate(:task, 'foo', "--description=This is a sample", "-r=#{@apptmp}/sample_project") }
29
29
  file_path = "#{@apptmp}/sample_project/tasks/foo.rake"
@@ -32,7 +32,7 @@ describe "TaskGenerator" do
32
32
  assert_match_in_file(/task :foo => :environment do/, file_path)
33
33
  end
34
34
 
35
- should "generate task file with namespace" do
35
+ it 'should generate task file with namespace' do
36
36
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}") }
37
37
  capture_io { generate(:task, 'foo', "--namespace=Sample", "-r=#{@apptmp}/sample_project") }
38
38
  file_path = "#{@apptmp}/sample_project/tasks/sample_foo.rake"
@@ -41,7 +41,7 @@ describe "TaskGenerator" do
41
41
  assert_no_match_in_file(/desc/, file_path)
42
42
  end
43
43
 
44
- should "generate task file with snake case name when using camelized name" do
44
+ it 'should generate task file with snake case name when using camelized name' do
45
45
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}") }
46
46
  capture_io { generate(:task, 'DemoTask', "--namespace=Sample", "--description=This is a sample", "-r=#{@apptmp}/sample_project") }
47
47
  file_path = "#{@apptmp}/sample_project/tasks/sample_demo_task.rake"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-02-09 00:00:00.000000000 Z
14
+ date: 2014-04-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: padrino-core
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.12.0
22
+ version: 0.12.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.12.0
29
+ version: 0.12.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: bundler
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -47,28 +47,28 @@ dependencies:
47
47
  requirements:
48
48
  - - '='
49
49
  - !ruby/object:Gem::Version
50
- version: 0.12.0
50
+ version: 0.12.1
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - '='
56
56
  - !ruby/object:Gem::Version
57
- version: 0.12.0
57
+ version: 0.12.1
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: padrino-mailer
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - '='
63
63
  - !ruby/object:Gem::Version
64
- version: 0.12.0
64
+ version: 0.12.1
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - '='
70
70
  - !ruby/object:Gem::Version
71
- version: 0.12.0
71
+ version: 0.12.1
72
72
  description: Generators for easily creating and building padrino applications from
73
73
  the console
74
74
  email: padrinorb@gmail.com
@@ -98,6 +98,7 @@ files:
98
98
  - lib/padrino-gen/generators/components/orms/activerecord.rb
99
99
  - lib/padrino-gen/generators/components/orms/couchrest.rb
100
100
  - lib/padrino-gen/generators/components/orms/datamapper.rb
101
+ - lib/padrino-gen/generators/components/orms/dynamoid.rb
101
102
  - lib/padrino-gen/generators/components/orms/minirecord.rb
102
103
  - lib/padrino-gen/generators/components/orms/mongoid.rb
103
104
  - lib/padrino-gen/generators/components/orms/mongomapper.rb