scaffold-bootstrap3 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzY3YzcyYjgzYjg3Mzg1YWIyY2JhODM1MjI1ODRhMGE0Zjg2ODQ1Zg==
4
+ NzA0NzViY2IwMmRmYzE0NzA2NzNiZGZkYzI3NWEyMzNhYmYzNzM5NQ==
5
5
  data.tar.gz: !binary |-
6
- Y2U3OWIxZDAxZGI1NTYwNzlmOGMyMWUyNzQ2NTQ0MDYxMmM2ZGU3NA==
6
+ ZDM3NTg5Y2QxMjgyMDU4NDk3OTdkOGU0MjhkNTU3MjM2ZWZkNzM0Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjIzMzdkZjQxOTQ4NzdlNWVlNDQzZGRkMDFiZjY0YjkxNDQ2NmQ4ZDk0NjI1
10
- MWI3ZWY2Yjc3NDFhMzhkNzU1ODY3MjMzYzJjOTk1MmFmYzRiMzg5OGJmOTFi
11
- NzM5ZTIxNzViNjNhZmU0YTgxN2U1ZmE2YzEzNDE5MDk5MmFmM2I=
9
+ NDhjYmNmNTQ0M2M0ZWNhOTE0ODM1ZjA4NDM3MGExZjVlZGZiZmFmMmNjMmJj
10
+ MmM3ODViYWE3ZmE0OTlmYzAwYjEwNThlNzVkNjVlOTkyNWU5MTRkNTY4NmZm
11
+ YzMwM2RhMTViN2ZiNDU1YmFhNzI1NjA5NjBmOTVkNDZhYTRmMjk=
12
12
  data.tar.gz: !binary |-
13
- NzQ5YjVjYTFlYTUyYmRmZTAwNjdjMDZiMjRhNDBlZThjZjYwNzI5ZDYzZjMy
14
- ZjBjNWIwMzFmNDMyY2M2NmFmMjg5YWNmNWZmZmI4OTUyYjZjZDg3YjA3MmQx
15
- OTA2M2NkYmMzZjE1NWM1MjA3NDg1MDhjYzVhN2RhYzY4Mzg0YTg=
13
+ OTBhMTVjZThkMzcxNWVmMjIwNTg2NTZiODY3OTI2N2Q2ZTUxY2I4NWZhZDgy
14
+ OTI4ZDIwY2JjZmJhNDc0MWUyYmViYzMwNTQ4NDI0ZjM5NDg3YjgyMGY2ZGZl
15
+ ZDI3NTlhODg0ZTI3MmNiMTBlNmNlMWJmZjY5ZWVmMjQyMDlmNGQ=
data/.travis.yml ADDED
@@ -0,0 +1,16 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - 2.0.0
7
+ gemfile:
8
+ - gemfiles/rails_3_1.gemfile
9
+ - gemfiles/rails_3_2.gemfile
10
+ - gemfiles/rails_4_0.gemfile
11
+ matrix:
12
+ exclude:
13
+ - rvm: 1.8.7
14
+ gemfile: gemfiles/rails_4_0.gemfile
15
+ - rvm: 1.9.2
16
+ gemfile: gemfiles/rails_4_0.gemfile
data/Appraisals ADDED
@@ -0,0 +1,11 @@
1
+ appraise "rails_3_1" do
2
+ gem "rails", "~> 3.1.0"
3
+ end
4
+
5
+ appraise "rails_3_2" do
6
+ gem "rails", "~> 3.2.0"
7
+ end
8
+
9
+ appraise "rails_4_0" do
10
+ gem "rails", "~> 4.0.0"
11
+ end
data/Rakefile CHANGED
@@ -1 +1,13 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'appraisal'
5
+
6
+ require 'rake/testtask'
7
+ Rake::TestTask.new(:test) do |test|
8
+ test.libs << 'lib' << 'test'
9
+ test.pattern = 'test/**/*_test.rb'
10
+ test.verbose = true
11
+ end
12
+
13
+ task :default => :test
File without changes
@@ -0,0 +1,58 @@
1
+ TestApp.routes.draw do |map|
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get :short
20
+ # post :toggle
21
+ # end
22
+ #
23
+ # collection do
24
+ # get :sold
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get :recent, :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ # root :to => "welcome#index"
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+ # match ':controller(/:action(/:id(.:format)))'
58
+ end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.1.0"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.2.0"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.0.0"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+ require 'lib/generators/haml/testing_helper'
3
+
4
+ class Haml::Generators::ControllerGeneratorTest < Rails::Generators::TestCase
5
+ destination File.join(Rails.root)
6
+ tests Rails::Generators::ControllerGenerator
7
+ arguments %w(Account foo bar --template-engine haml)
8
+
9
+ setup :prepare_destination
10
+ setup :copy_routes
11
+
12
+ test "should invoke template engine" do
13
+ run_generator
14
+ assert_file "app/views/account/foo.html.haml", %r(app/views/account/foo\.html\.haml)
15
+ assert_file "app/views/account/bar.html.haml", %r(app/views/account/bar\.html\.haml)
16
+ end
17
+ end
@@ -0,0 +1,24 @@
1
+ require 'test_helper'
2
+ require 'lib/generators/haml/testing_helper'
3
+
4
+ class Haml::Generators::MailerGeneratorTest < Rails::Generators::TestCase
5
+ destination File.join(Rails.root)
6
+ tests Rails::Generators::MailerGenerator
7
+ arguments %w(notifier foo bar --template-engine haml)
8
+
9
+ setup :prepare_destination
10
+ setup :copy_routes
11
+
12
+ test "should invoke template engine" do
13
+ run_generator
14
+ assert_file "app/views/notifier/foo.text.haml" do |view|
15
+ assert_match %r(app/views/notifier/foo\.text\.haml), view
16
+ assert_match /\= @greeting/, view
17
+ end
18
+
19
+ assert_file "app/views/notifier/bar.text.haml" do |view|
20
+ assert_match %r(app/views/notifier/bar\.text\.haml), view
21
+ assert_match /\= @greeting/, view
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,31 @@
1
+ require 'test_helper'
2
+ require 'lib/generators/haml/testing_helper'
3
+
4
+ class Haml::Generators::ScaffoldGeneratorTest < Rails::Generators::TestCase
5
+ destination File.join(Rails.root)
6
+ tests Rails::Generators::ScaffoldGenerator
7
+ arguments %w(product_line title:string price:integer --template-engine haml)
8
+
9
+ setup :prepare_destination
10
+ setup :copy_routes
11
+
12
+ test "should invoke template engine" do
13
+ run_generator
14
+
15
+ %w(index edit new show _form).each { |view| assert_file "app/views/product_lines/#{view}.html.haml" }
16
+ assert_no_file "app/views/layouts/product_lines.html.haml"
17
+ end
18
+
19
+ test "should revoke template engine" do
20
+ run_generator
21
+ run_generator ["product_line"], :behavior => :revoke
22
+
23
+ assert_no_file "app/views/product_lines"
24
+ assert_no_file "app/views/layouts/product_lines.html.haml"
25
+ end
26
+
27
+ test "should invoke form builder" do
28
+ run_generator %w(product_line title:string price:integer --template-engine haml --form-builder some-form-builder)
29
+ assert_no_file "app/views/product_lines/_form.html.haml"
30
+ end
31
+ end
@@ -0,0 +1 @@
1
+ require_generators :haml => ['scaffold', 'controller', 'mailer']
@@ -1,5 +1,5 @@
1
1
  module Scaffold
2
2
  module Bootstrap3
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -27,4 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency "railties", [">= 3.1", "< 4.1"]
28
28
 
29
29
  spec.add_development_dependency "rails", [">= 3.1", "< 4.1"]
30
+ spec.add_development_dependency 'appraisal', '>= 0.3.8'
30
31
  end
data/test_helper.rb ADDED
@@ -0,0 +1,75 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'rails/all'
4
+ require 'rails/generators'
5
+ require 'rails/generators/test_case'
6
+
7
+ class TestApp < Rails::Application
8
+ config.root = File.dirname(__FILE__)
9
+ end
10
+ Rails.application = TestApp
11
+
12
+ module Rails
13
+ def self.root
14
+ @root ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp', 'rails'))
15
+ end
16
+ end
17
+ Rails.application.config.root = Rails.root
18
+
19
+ # Call configure to load the settings from
20
+ # Rails.application.config.generators to Rails::Generators
21
+ Rails::Generators.configure! Rails.application.config.generators
22
+
23
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
24
+
25
+ def copy_routes
26
+ routes = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'routes.rb'))
27
+ destination = File.join(Rails.root, "config")
28
+ FileUtils.mkdir_p(destination)
29
+ FileUtils.cp File.expand_path(routes), destination
30
+ end
31
+
32
+ # Asserts the given class exists in the given content. When a block is given,
33
+ # it yields the content of the class.
34
+ #
35
+ # assert_file "test/functional/accounts_controller_test.rb" do |controller_test|
36
+ # assert_class "AccountsControllerTest", controller_test do |klass|
37
+ # assert_match /context "index action"/, klass
38
+ # end
39
+ # end
40
+ #
41
+ def assert_class(klass, content)
42
+ assert content =~ /class #{klass}(\(.+\))?(.*?)\nend/m, "Expected to have class #{klass}"
43
+ yield $2.strip if block_given?
44
+ end
45
+
46
+ def generator_list
47
+ {
48
+ :rails => ['scaffold', 'controller', 'mailer'],
49
+ :haml => ['scaffold', 'controller', 'mailer']
50
+ }
51
+ end
52
+
53
+ def path_prefix(name)
54
+ case name
55
+ when :rails
56
+ 'rails/generators'
57
+ else
58
+ 'generators'
59
+ end
60
+ end
61
+
62
+ def require_generators(generator_list)
63
+ generator_list.each do |name, generators|
64
+ generators.each do |generator_name|
65
+ if name.to_s == 'rails' && generator_name.to_s == 'mailer'
66
+ require File.join(path_prefix(name), generator_name.to_s, "#{generator_name}_generator")
67
+ else
68
+ require File.join(path_prefix(name), name.to_s, generator_name.to_s, "#{generator_name}_generator")
69
+ end
70
+ end
71
+ end
72
+ end
73
+ alias :require_generator :require_generators
74
+
75
+ require_generators generator_list
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffold-bootstrap3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Sutcliffe
@@ -138,6 +138,20 @@ dependencies:
138
138
  - - <
139
139
  - !ruby/object:Gem::Version
140
140
  version: '4.1'
141
+ - !ruby/object:Gem::Dependency
142
+ name: appraisal
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ! '>='
146
+ - !ruby/object:Gem::Version
147
+ version: 0.3.8
148
+ type: :development
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: 0.3.8
141
155
  description: Scaffold Bootstrap3 takes the advantage of bootstrap3 to generate your
142
156
  scaffolds and controllers with a basic bootstrap classes, for a minimun effort development.
143
157
  email:
@@ -148,24 +162,35 @@ extensions: []
148
162
  extra_rdoc_files: []
149
163
  files:
150
164
  - .gitignore
165
+ - .travis.yml
166
+ - Appraisals
151
167
  - Gemfile
152
168
  - LICENSE.txt
153
169
  - README.md
154
170
  - Rakefile
155
171
  - bin/scaffold-bootstrap3
172
+ - fixtures/routes.rb
173
+ - gemfiles/rails_3_1.gemfile
174
+ - gemfiles/rails_3_2.gemfile
175
+ - gemfiles/rails_4_0.gemfile
156
176
  - lib/generators/haml/controller/controller_generator.rb
157
177
  - lib/generators/haml/controller/templates/view.html.haml
178
+ - lib/generators/haml/controller_generator_test.rb
158
179
  - lib/generators/haml/mailer/mailer_generator.rb
159
180
  - lib/generators/haml/mailer/templates/view.text.haml
181
+ - lib/generators/haml/mailer_generator_test.rb
160
182
  - lib/generators/haml/scaffold/scaffold_generator.rb
161
183
  - lib/generators/haml/scaffold/templates/_form.html.haml
162
184
  - lib/generators/haml/scaffold/templates/edit.html.haml
163
185
  - lib/generators/haml/scaffold/templates/index.html.haml
164
186
  - lib/generators/haml/scaffold/templates/new.html.haml
165
187
  - lib/generators/haml/scaffold/templates/show.html.haml
188
+ - lib/generators/haml/scaffold_generator_test.rb
189
+ - lib/generators/haml/testing_helper.rb
166
190
  - lib/scaffold/bootstrap3.rb
167
191
  - lib/scaffold/bootstrap3/version.rb
168
192
  - scaffold-bootstrap3.gemspec
193
+ - test_helper.rb
169
194
  homepage: http://github.com/paulsutcliffe/scaffold-bootstrap3
170
195
  licenses:
171
196
  - MIT