bootstrap-generators 3.1.1 → 3.1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +16 -2
- data/.travis.yml +7 -1
- data/Gemfile +15 -9
- data/Rakefile +2 -1
- data/bootstrap-generators.gemspec +20 -23
- data/lib/bootstrap-generators.rb +1 -1
- data/lib/bootstrap/generators/version.rb +1 -1
- data/lib/generators/bootstrap/install/install_generator.rb +2 -2
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +68 -0
- data/test/dummy/config/boot.rb +6 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/test.rb +34 -0
- data/test/generators/bootstrap/install_generator_test.rb +86 -0
- data/test/test_helper.rb +4 -38
- metadata +28 -26
- data/test/fixtures/application.js +0 -3
- data/test/fixtures/routes.rb +0 -59
- data/test/lib/generators/bootstrap/install_generator_test.rb +0 -119
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26d726211095cbab4de3df3ee9c7057512ea7f15
|
4
|
+
data.tar.gz: e2ce107bef326e9248dca4fa11c52db39df57c2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 185372e7cf2692f04ee25a54ef433b3cc7ffb3b2773fa70e3db09b23c4e6c9a026bb6f61a7cfbcef2d534b00874f17427c70b8d83ecbba96f3484718af2752b9
|
7
|
+
data.tar.gz: e6f578fde53708e0190490fafd6cc7249da6182de6727b526fb6f3ac373dd2f9297130d4078ba0bec10047d1c64dc46258418a03f1ddaa90495aff5ac162664e
|
data/.gitignore
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
*.gem
|
2
|
+
*.rbc
|
2
3
|
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
3
6
|
Gemfile.lock
|
4
|
-
|
5
|
-
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/dummy/db/*.sqlite3
|
16
|
+
test/dummy/log/*.log
|
17
|
+
test/tmp
|
18
|
+
test/version_tmp
|
19
|
+
tmp
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
#
|
4
|
-
# Bundler will treat runtime dependencies like base dependencies, and
|
5
|
-
# development dependencies will be added by default to the :development group.
|
3
|
+
# Specify your gem's dependencies in bootstrap_generators.gemspec
|
6
4
|
gemspec
|
7
5
|
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
# Dummy application
|
7
|
+
rails_version = ENV["RAILS_VERSION"] || "default"
|
8
|
+
rails = case rails_version
|
9
|
+
when "master"
|
10
|
+
{ github: "rails/rails" }
|
11
|
+
when "default"
|
12
|
+
">= 3.1.0"
|
13
|
+
else
|
14
|
+
"~> #{rails_version}"
|
15
|
+
end
|
12
16
|
|
13
|
-
|
14
|
-
|
17
|
+
gem "rails", rails
|
18
|
+
|
19
|
+
gem 'sass-rails'
|
20
|
+
gem 'uglifier'
|
data/Rakefile
CHANGED
@@ -1,30 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require "bootstrap/generators/version"
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
s.license = "MIT"
|
16
|
-
|
17
|
-
s.rubyforge_project = "bootstrap-generators"
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "bootstrap-generators"
|
8
|
+
spec.version = Bootstrap::Generators::VERSION
|
9
|
+
spec.authors = ["Décio Ferreira"]
|
10
|
+
spec.email = ["decio.ferreira@decioferreira.com"]
|
11
|
+
spec.summary = %q{Bootstrap-generators provides Twitter Bootstrap generators for Rails 4 (supported Rails >= 3.1).}
|
12
|
+
spec.description = %q{Bootstrap-generators provides Twitter Bootstrap generators for Rails 4 (supported Rails >= 3.1). Checkout http://getbootstrap.com.}
|
13
|
+
spec.homepage = "https://github.com/decioferreira/bootstrap-generators"
|
14
|
+
spec.license = "MIT"
|
18
15
|
|
19
|
-
|
20
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
-
s.require_paths = ["lib"]
|
16
|
+
spec.rubyforge_project = "bootstrap-generators"
|
23
17
|
|
24
|
-
|
25
|
-
|
18
|
+
spec.files = `git ls-files`.split($/)
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
spec.require_paths = ["lib"]
|
26
22
|
|
27
|
-
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
24
|
+
spec.add_development_dependency "rake"
|
28
25
|
|
29
|
-
|
26
|
+
spec.add_runtime_dependency "railties", ">= 3.1.0"
|
30
27
|
end
|
data/lib/bootstrap-generators.rb
CHANGED
@@ -5,7 +5,7 @@ module Bootstrap
|
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
config.app_generators.stylesheets false
|
7
7
|
|
8
|
-
initializer 'bootstrap-generators.setup' do |app|
|
8
|
+
initializer 'bootstrap-generators.setup', group: :all do |app|
|
9
9
|
app.config.less.paths << ::File.expand_path('../../vendor/twitter/bootstrap/less', __FILE__) if app.config.respond_to?(:less)
|
10
10
|
app.config.assets.paths << ::File.expand_path('../../vendor/twitter/bootstrap/sass', __FILE__) if app.config.respond_to?(:sass)
|
11
11
|
|
@@ -32,10 +32,10 @@ module Bootstrap
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def inject_backbone
|
35
|
-
application_js_path =
|
35
|
+
application_js_path = 'app/assets/javascripts/application.js'
|
36
36
|
|
37
37
|
if ::File.exists?(::File.join(destination_root, application_js_path))
|
38
|
-
inject_into_file application_js_path, :
|
38
|
+
inject_into_file application_js_path, before: '//= require_tree' do
|
39
39
|
"//= require bootstrap\n"
|
40
40
|
end
|
41
41
|
end
|
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require_tree .
|
13
|
+
*/
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
# require 'active_record/railtie'
|
5
|
+
require 'action_controller/railtie'
|
6
|
+
require 'action_mailer/railtie'
|
7
|
+
# require 'active_resource/railtie'
|
8
|
+
require 'sprockets/railtie'
|
9
|
+
# require 'rails/test_unit/railtie'
|
10
|
+
|
11
|
+
if defined?(Bundler)
|
12
|
+
# If you precompile assets before deploying to production, use this line
|
13
|
+
Bundler.require(*Rails.groups(assets: %w(development test)))
|
14
|
+
# If you want your assets lazily compiled in production, use this line
|
15
|
+
# Bundler.require(:default, :assets, Rails.env)
|
16
|
+
end
|
17
|
+
|
18
|
+
module Dummy
|
19
|
+
class Application < Rails::Application
|
20
|
+
# Settings in config/environments/* take precedence over those specified here.
|
21
|
+
# Application configuration should go into files in config/initializers
|
22
|
+
# -- all .rb files in that directory are automatically loaded.
|
23
|
+
|
24
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
25
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
26
|
+
|
27
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
28
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
29
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
30
|
+
|
31
|
+
# Activate observers that should always be running.
|
32
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
33
|
+
|
34
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
35
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
36
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
37
|
+
|
38
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
39
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
40
|
+
# config.i18n.default_locale = :de
|
41
|
+
|
42
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
43
|
+
config.encoding = 'utf-8'
|
44
|
+
|
45
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
46
|
+
config.filter_parameters += [:password]
|
47
|
+
|
48
|
+
# Enable escaping HTML in JSON.
|
49
|
+
config.active_support.escape_html_entities_in_json = true
|
50
|
+
|
51
|
+
# Use SQL instead of Active Record's schema dumper when creating the database.
|
52
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
53
|
+
# like if you have constraints or database-specific column types
|
54
|
+
# config.active_record.schema_format = :sql
|
55
|
+
|
56
|
+
# Enforce whitelist mode for mass assignment.
|
57
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
58
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
59
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
60
|
+
# config.active_record.whitelist_attributes = true
|
61
|
+
|
62
|
+
# Enable the asset pipeline
|
63
|
+
config.assets.enabled = true
|
64
|
+
|
65
|
+
# Version of your assets, change this if you want to expire all your assets
|
66
|
+
config.assets.version = '1.0'
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = 'public, max-age=3600'
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
15
|
+
config.whiny_nils = true
|
16
|
+
|
17
|
+
# Show full error reports and disable caching
|
18
|
+
config.consider_all_requests_local = true
|
19
|
+
config.action_controller.perform_caching = false
|
20
|
+
|
21
|
+
# Raise exceptions instead of rendering exception templates
|
22
|
+
config.action_dispatch.show_exceptions = false
|
23
|
+
|
24
|
+
# Disable request forgery protection in test environment
|
25
|
+
config.action_controller.allow_forgery_protection = false
|
26
|
+
|
27
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
28
|
+
# The :test delivery method accumulates sent emails in the
|
29
|
+
# ActionMailer::Base.deliveries array.
|
30
|
+
config.action_mailer.delivery_method = :test
|
31
|
+
|
32
|
+
# Print deprecation notices to the stderr
|
33
|
+
config.active_support.deprecation = :stderr
|
34
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'generators/bootstrap/install/install_generator'
|
3
|
+
|
4
|
+
class InstallGeneratorTest < Rails::Generators::TestCase
|
5
|
+
tests Bootstrap::Generators::InstallGenerator
|
6
|
+
destination File.expand_path('../../../../tmp', __FILE__)
|
7
|
+
arguments %w(-f)
|
8
|
+
|
9
|
+
setup do
|
10
|
+
prepare_destination
|
11
|
+
prepare_dummy_app
|
12
|
+
end
|
13
|
+
|
14
|
+
test 'precompile assets' do
|
15
|
+
generator.application 'config.assets.initialize_on_precompile = false'
|
16
|
+
run_generator %W(-f --stylesheet-engine scss)
|
17
|
+
# quietly { generator.rake 'assets:precompile' }
|
18
|
+
generator.rake 'assets:precompile' # temporarily display errors
|
19
|
+
assert_equal 0, $?.exitstatus
|
20
|
+
end
|
21
|
+
|
22
|
+
templating_systems = %w{erb haml slim}
|
23
|
+
templating_systems.each do |templating_system|
|
24
|
+
test "should copy controller #{templating_system} templates" do
|
25
|
+
run_generator %W(-f --template-engine #{templating_system})
|
26
|
+
|
27
|
+
assert_file "lib/templates/#{templating_system}/controller/view.html.#{templating_system}"
|
28
|
+
(templating_systems - [templating_system]).each do |other_templating_system|
|
29
|
+
assert_no_file "lib/templates/#{other_templating_system}/controller/view.html.#{other_templating_system}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should copy scaffold #{templating_system} templates" do
|
34
|
+
run_generator %W(-f --template-engine #{templating_system})
|
35
|
+
|
36
|
+
%w(index edit new show _form).each do |view|
|
37
|
+
assert_file "lib/templates/#{templating_system}/scaffold/#{view}.html.#{templating_system}"
|
38
|
+
(templating_systems - [templating_system]).each do |other_templating_system|
|
39
|
+
assert_no_file "lib/templates/#{other_templating_system}/scaffold/#{view}.html.#{other_templating_system}"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
test "should create #{templating_system} layout" do
|
45
|
+
run_generator %W(-f --template-engine #{templating_system})
|
46
|
+
|
47
|
+
assert_file "app/views/layouts/application.html.#{templating_system}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
test 'should copy css files' do
|
52
|
+
run_generator %w(-f --stylesheet-engine css)
|
53
|
+
|
54
|
+
assert_file 'app/assets/stylesheets/bootstrap-generators.css'
|
55
|
+
end
|
56
|
+
|
57
|
+
css_preprocessors = %w{scss less}
|
58
|
+
css_preprocessors.each do |css_preprocessor|
|
59
|
+
test "should copy #{css_preprocessor} files" do
|
60
|
+
run_generator %W(-f --stylesheet-engine #{css_preprocessor})
|
61
|
+
|
62
|
+
assert_file "app/assets/stylesheets/bootstrap-generators.#{css_preprocessor}"
|
63
|
+
assert_file "app/assets/stylesheets/bootstrap-variables.#{css_preprocessor}"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
test 'should require javascript bootstrap file' do
|
68
|
+
run_generator
|
69
|
+
|
70
|
+
assert_file 'app/assets/javascripts/application.js', /require bootstrap/
|
71
|
+
end
|
72
|
+
|
73
|
+
test 'should work when there is no application.js file' do
|
74
|
+
File.delete(File.join(destination_root, 'app/assets/javascripts/application.js'))
|
75
|
+
|
76
|
+
assert_nothing_raised Errno::ENOENT do
|
77
|
+
run_generator
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def prepare_dummy_app
|
84
|
+
FileUtils.cp_r('test/dummy/.', destination_root)
|
85
|
+
end
|
86
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,41 +1,7 @@
|
|
1
|
-
|
2
|
-
Bundler.require
|
1
|
+
ENV['RAILS_ENV'] = 'test'
|
3
2
|
|
4
|
-
require '
|
5
|
-
require 'rails/
|
6
|
-
require 'rails/generators'
|
3
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
4
|
+
require 'rails/test_help'
|
7
5
|
require 'rails/generators/test_case'
|
8
6
|
|
9
|
-
|
10
|
-
config.root = File.dirname(__FILE__)
|
11
|
-
end
|
12
|
-
Rails.application = TestApp
|
13
|
-
|
14
|
-
module Rails
|
15
|
-
def self.root
|
16
|
-
@root ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp', 'rails'))
|
17
|
-
end
|
18
|
-
end
|
19
|
-
Rails.application.config.root = Rails.root
|
20
|
-
|
21
|
-
# Call configure to load the settings from
|
22
|
-
# Rails.application.config.generators to Rails::Generators
|
23
|
-
# Rails::Generators.configure!
|
24
|
-
|
25
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
26
|
-
|
27
|
-
def copy_routes
|
28
|
-
routes = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'routes.rb'))
|
29
|
-
destination = File.join(Rails.root, "config")
|
30
|
-
FileUtils.mkdir_p(destination)
|
31
|
-
FileUtils.cp routes, destination
|
32
|
-
end
|
33
|
-
|
34
|
-
def copy_application_javascript
|
35
|
-
application_js = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'application.js'))
|
36
|
-
destination = File.join(Rails.root, "app", "assets", "javascripts")
|
37
|
-
FileUtils.mkdir_p(destination)
|
38
|
-
FileUtils.cp application_js, destination
|
39
|
-
end
|
40
|
-
|
41
|
-
require 'generators/bootstrap/install/install_generator'
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.1
|
4
|
+
version: 3.1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Décio Ferreira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,36 +38,22 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rails
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.1'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.1'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: railties
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
47
|
+
version: 3.1.0
|
62
48
|
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: 3.1.0
|
69
55
|
description: Bootstrap-generators provides Twitter Bootstrap generators for Rails
|
70
|
-
4 (supported Rails >= 3.1). Checkout http://
|
56
|
+
4 (supported Rails >= 3.1). Checkout http://getbootstrap.com.
|
71
57
|
email:
|
72
58
|
- decio.ferreira@decioferreira.com
|
73
59
|
executables: []
|
@@ -111,9 +97,15 @@ files:
|
|
111
97
|
- lib/generators/bootstrap/install/templates/lib/templates/slim/scaffold/new.html.slim
|
112
98
|
- lib/generators/bootstrap/install/templates/lib/templates/slim/scaffold/show.html.slim
|
113
99
|
- readme-template.md.erb
|
114
|
-
- test/
|
115
|
-
- test/
|
116
|
-
- test/
|
100
|
+
- test/dummy/Rakefile
|
101
|
+
- test/dummy/app/assets/javascripts/application.js
|
102
|
+
- test/dummy/app/assets/stylesheets/application.css
|
103
|
+
- test/dummy/config.ru
|
104
|
+
- test/dummy/config/application.rb
|
105
|
+
- test/dummy/config/boot.rb
|
106
|
+
- test/dummy/config/environment.rb
|
107
|
+
- test/dummy/config/environments/test.rb
|
108
|
+
- test/generators/bootstrap/install_generator_test.rb
|
117
109
|
- test/test_helper.rb
|
118
110
|
- vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot
|
119
111
|
- vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.svg
|
@@ -213,7 +205,7 @@ files:
|
|
213
205
|
- vendor/twitter/bootstrap/sass/_variables.scss
|
214
206
|
- vendor/twitter/bootstrap/sass/_wells.scss
|
215
207
|
- vendor/twitter/bootstrap/sass/bootstrap.scss
|
216
|
-
homepage: https://github.com/decioferreira/bootstrap-generators
|
208
|
+
homepage: https://github.com/decioferreira/bootstrap-generators
|
217
209
|
licenses:
|
218
210
|
- MIT
|
219
211
|
metadata: {}
|
@@ -238,4 +230,14 @@ signing_key:
|
|
238
230
|
specification_version: 4
|
239
231
|
summary: Bootstrap-generators provides Twitter Bootstrap generators for Rails 4 (supported
|
240
232
|
Rails >= 3.1).
|
241
|
-
test_files:
|
233
|
+
test_files:
|
234
|
+
- test/dummy/Rakefile
|
235
|
+
- test/dummy/app/assets/javascripts/application.js
|
236
|
+
- test/dummy/app/assets/stylesheets/application.css
|
237
|
+
- test/dummy/config.ru
|
238
|
+
- test/dummy/config/application.rb
|
239
|
+
- test/dummy/config/boot.rb
|
240
|
+
- test/dummy/config/environment.rb
|
241
|
+
- test/dummy/config/environments/test.rb
|
242
|
+
- test/generators/bootstrap/install_generator_test.rb
|
243
|
+
- test/test_helper.rb
|
data/test/fixtures/routes.rb
DELETED
@@ -1,59 +0,0 @@
|
|
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
|
59
|
-
|
@@ -1,119 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class InstallGeneratorTest < Rails::Generators::TestCase
|
4
|
-
tests Bootstrap::Generators::InstallGenerator
|
5
|
-
destination File.join(Rails.root)
|
6
|
-
arguments %w(--template-engine erb)
|
7
|
-
|
8
|
-
setup :prepare_destination
|
9
|
-
setup :copy_routes
|
10
|
-
setup :copy_application_javascript
|
11
|
-
|
12
|
-
test "should copy controller erb templates" do
|
13
|
-
run_generator
|
14
|
-
|
15
|
-
assert_file "lib/templates/erb/controller/view.html.erb"
|
16
|
-
assert_no_file "lib/templates/haml/controller/view.html.haml"
|
17
|
-
assert_no_file "lib/templates/slim/controller/view.html.slim"
|
18
|
-
end
|
19
|
-
|
20
|
-
test "should copy controller slim templates" do
|
21
|
-
run_generator %w(--template-engine slim)
|
22
|
-
|
23
|
-
assert_file "lib/templates/slim/controller/view.html.slim"
|
24
|
-
assert_no_file "lib/templates/erb/controller/view.html.erb"
|
25
|
-
assert_no_file "lib/templates/haml/controller/view.html.haml"
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
test "should copy controller haml templates" do
|
30
|
-
run_generator %w(--template-engine haml)
|
31
|
-
|
32
|
-
assert_file "lib/templates/haml/controller/view.html.haml"
|
33
|
-
assert_no_file "lib/templates/erb/controller/view.html.erb"
|
34
|
-
assert_no_file "lib/templates/slim/controller/view.html.slim"
|
35
|
-
end
|
36
|
-
|
37
|
-
test "should copy scaffold erb templates" do
|
38
|
-
run_generator
|
39
|
-
|
40
|
-
%w(index edit new show _form).each { |view|
|
41
|
-
assert_file "lib/templates/erb/scaffold/#{view}.html.erb"
|
42
|
-
assert_no_file "lib/templates/haml/scaffold/#{view}.html.haml"
|
43
|
-
assert_no_file "lib/templates/slim/scaffold/#{view}.html.slim"
|
44
|
-
}
|
45
|
-
end
|
46
|
-
|
47
|
-
test "should copy scaffold slim templates" do
|
48
|
-
run_generator %w(--template-engine slim)
|
49
|
-
|
50
|
-
%w(index edit new show _form).each { |view|
|
51
|
-
assert_file "lib/templates/slim/scaffold/#{view}.html.slim"
|
52
|
-
assert_no_file "lib/templates/erb/scaffold/#{view}.html.erb"
|
53
|
-
assert_no_file "lib/templates/haml/scaffold/#{view}.html.haml"
|
54
|
-
}
|
55
|
-
end
|
56
|
-
|
57
|
-
|
58
|
-
test "should copy scaffold haml templates" do
|
59
|
-
run_generator %w(--template-engine haml)
|
60
|
-
|
61
|
-
%w(index edit new show _form).each { |view|
|
62
|
-
assert_file "lib/templates/haml/scaffold/#{view}.html.haml"
|
63
|
-
assert_no_file "lib/templates/erb/scaffold/#{view}.html.erb"
|
64
|
-
assert_no_file "lib/templates/slim/scaffold/#{view}.html.slim"
|
65
|
-
}
|
66
|
-
end
|
67
|
-
|
68
|
-
test "should require javascript bootstrap file" do
|
69
|
-
run_generator
|
70
|
-
|
71
|
-
assert_file "app/assets/javascripts/application.js", /require bootstrap/
|
72
|
-
end
|
73
|
-
|
74
|
-
test "should work when there is no application.js file" do
|
75
|
-
File.delete(File.join(destination_root, "app/assets/javascripts/application.js"))
|
76
|
-
|
77
|
-
assert_nothing_raised Errno::ENOENT do
|
78
|
-
run_generator
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
test "should copy css files" do
|
83
|
-
run_generator %w(--stylesheet-engine css)
|
84
|
-
|
85
|
-
assert_file "app/assets/stylesheets/bootstrap-generators.css"
|
86
|
-
end
|
87
|
-
|
88
|
-
test "should copy scss files" do
|
89
|
-
run_generator %w(--stylesheet-engine scss)
|
90
|
-
|
91
|
-
assert_file "app/assets/stylesheets/bootstrap-generators.scss"
|
92
|
-
assert_file "app/assets/stylesheets/bootstrap-variables.scss"
|
93
|
-
end
|
94
|
-
|
95
|
-
test "should copy less files" do
|
96
|
-
run_generator %w(--stylesheet-engine less)
|
97
|
-
|
98
|
-
assert_file "app/assets/stylesheets/bootstrap-generators.less"
|
99
|
-
assert_file "app/assets/stylesheets/bootstrap-variables.less"
|
100
|
-
end
|
101
|
-
|
102
|
-
test "should create slim layout" do
|
103
|
-
run_generator %w(--template-engine slim)
|
104
|
-
|
105
|
-
assert_file "app/views/layouts/application.html.slim"
|
106
|
-
end
|
107
|
-
|
108
|
-
test "should create erb layout" do
|
109
|
-
run_generator
|
110
|
-
|
111
|
-
assert_file "app/views/layouts/application.html.erb"
|
112
|
-
end
|
113
|
-
|
114
|
-
test "should create haml layout" do
|
115
|
-
run_generator %w(--template-engine haml)
|
116
|
-
|
117
|
-
assert_file "app/views/layouts/application.html.haml"
|
118
|
-
end
|
119
|
-
end
|