Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit d61c007

Browse files
committed
Merge pull request #10 from lumoslabs/rails4-able
rails 4 readiness. Removed dependency on rails dummy app
2 parents bf4e6ef + 25aadcc commit d61c007

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+124
-781
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
language: ruby
22
rvm:
3-
- 2.0.0-p353
3+
- 2.1.6
44

5-
before_script: cd spec/dummy && bundle exec rake db:test:prepare && cd ../..
65
script: bundle exec rspec spec
6+
env:
7+
- RAILS_VERSION=4.0
8+
- RAILS_VERSION=3.2
9+

Gemfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
source "https://rubygems.org"
22

3+
# this is for testing the gem against multiple rails versions
4+
rails_version = ENV["RAILS_VERSION"]
5+
gem "rails", rails_version
6+
37
# Declare your gem's dependencies in bootstrap_haml_helpers.gemspec.
48
# Bundler will treat runtime dependencies like base dependencies, and
59
# development dependencies will be added by default to the :development group.
610
gemspec
711

8-
# jquery-rails is used by the dummy application
9-
gem "jquery-rails"
10-
1112
group :development, :test do
1213
gem 'capybara'
14+
gem 'guard-rspec'
1315
end
1416

1517
# Declare any dependencies that are still in development here instead of in

Guardfile

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# A sample Guardfile
2+
# More info at https://github.com/guard/guard#readme
3+
4+
## Uncomment and set this to only include directories you want to watch
5+
# directories %w(app lib config test spec features)
6+
7+
## Uncomment to clear the screen before every task
8+
# clearing :on
9+
10+
## Guard internally checks for changes in the Guardfile and exits.
11+
## If you want Guard to automatically start up again, run guard in a
12+
## shell loop, e.g.:
13+
##
14+
## $ while bundle exec guard; do echo "Restarting Guard..."; done
15+
##
16+
## Note: if you are using the `directories` clause above and you are not
17+
## watching the project directory ('.'), then you will want to move
18+
## the Guardfile to a watched dir and symlink it back, e.g.
19+
#
20+
# $ mkdir config
21+
# $ mv Guardfile config/
22+
# $ ln -s config/Guardfile .
23+
#
24+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
25+
26+
# Note: The cmd option is now required due to the increasing number of ways
27+
# rspec may be run, below are examples of the most common uses.
28+
# * bundler: 'bundle exec rspec'
29+
# * bundler binstubs: 'bin/rspec'
30+
# * spring: 'bin/rspec' (This will use spring if running and you have
31+
# installed the spring binstubs per the docs)
32+
# * zeus: 'zeus rspec' (requires the server to be started separately)
33+
# * 'just' rspec: 'rspec'
34+
35+
guard :rspec, cmd: "bundle exec rspec" do
36+
require "guard/rspec/dsl"
37+
dsl = Guard::RSpec::Dsl.new(self)
38+
39+
# Feel free to open issues for suggestions and improvements
40+
41+
# RSpec files
42+
rspec = dsl.rspec
43+
watch(rspec.spec_helper) { rspec.spec_dir }
44+
watch(rspec.spec_support) { rspec.spec_dir }
45+
watch(rspec.spec_files)
46+
47+
# Ruby files
48+
ruby = dsl.ruby
49+
dsl.watch_spec_files_for(ruby.lib_files)
50+
51+
# Rails files
52+
rails = dsl.rails(view_extensions: %w(erb haml slim))
53+
dsl.watch_spec_files_for(rails.app_files)
54+
dsl.watch_spec_files_for(rails.views)
55+
56+
watch(rails.controllers) do |m|
57+
[
58+
rspec.spec.("routing/#{m[1]}_routing"),
59+
rspec.spec.("controllers/#{m[1]}_controller"),
60+
rspec.spec.("acceptance/#{m[1]}")
61+
]
62+
end
63+
64+
# Rails config changes
65+
watch(rails.spec_helper) { rspec.spec_dir }
66+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
67+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
68+
69+
# Capybara features specs
70+
watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
71+
72+
# Turnip features and steps
73+
watch(%r{^spec/acceptance/(.+)\.feature$})
74+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
75+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
76+
end
77+
end

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ HAML wrappers for [Twitter Bootstrap](http://getbootstrap.com/2.3.2) components.
55
[![Build Status](https://travis-ci.org/lumoslabs/bootstrap_haml_helpers.svg)](https://travis-ci.org/lumoslabs/bootstrap_haml_helpers)
66
[![Gem Version](https://badge.fury.io/rb/bootstrap_haml_helpers.svg)](http://badge.fury.io/rb/bootstrap_haml_helpers)
77

8+
How To Use The Components
9+
----
10+
```haml
11+
= container do
12+
woah!
13+
14+
= progress_bar do |pb|
15+
= pb.bar(40)
16+
```
17+
818
Integration
919
----
1020
To integrate our gem into your application, follow these steps:

bootstrap_haml_helpers.gemspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ Gem::Specification.new do |s|
1515

1616
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
1717

18-
s.add_dependency "rails", "~> 3.2.12"
18+
s.add_dependency "rails"
1919

2020
s.add_dependency "bootstrap-sass", "2.3.1.3"
21-
s.add_dependency "haml", "~> 3.1.7"
22-
s.add_dependency "sass-rails", "~> 3.2"
23-
s.add_dependency "sass", '3.2.19'
21+
s.add_dependency "haml"
22+
s.add_dependency "sass-rails"
23+
s.add_dependency "sass"
2424

2525
s.add_development_dependency 'sqlite3'
26-
s.add_development_dependency 'rspec-rails', '~> 2.14'
26+
s.add_development_dependency 'rspec-rails'
2727
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# dummy class to enable the namespace
2+
module BootstrapHamlHelpers
3+
module Component
4+
end
5+
end

lib/bootstrap_haml_helpers/engine.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'rails'
2+
require 'bootstrap_haml_helpers/component.rb'
23
require 'bootstrap_haml_helpers/controller_helpers'
34

45
module BootstrapHamlHelpers

0 commit comments

Comments
 (0)