Skip to content

Commit

Permalink
Merge pull request #10 from lumoslabs/rails4-able
Browse files Browse the repository at this point in the history
rails 4 readiness. Removed dependency on rails dummy app
  • Loading branch information
jdoconnor committed May 4, 2015
2 parents bf4e6ef + 25aadcc commit d61c007
Show file tree
Hide file tree
Showing 45 changed files with 124 additions and 781 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: ruby
rvm:
- 2.0.0-p353
- 2.1.6

before_script: cd spec/dummy && bundle exec rake db:test:prepare && cd ../..
script: bundle exec rspec spec
env:
- RAILS_VERSION=4.0
- RAILS_VERSION=3.2

8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
source "https://rubygems.org"

# this is for testing the gem against multiple rails versions
rails_version = ENV["RAILS_VERSION"]
gem "rails", rails_version

# Declare your gem's dependencies in bootstrap_haml_helpers.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

# jquery-rails is used by the dummy application
gem "jquery-rails"

group :development, :test do
gem 'capybara'
gem 'guard-rspec'
end

# Declare any dependencies that are still in development here instead of in
Expand Down
77 changes: 77 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features)

## Uncomment to clear the screen before every task
# clearing :on

## Guard internally checks for changes in the Guardfile and exits.
## If you want Guard to automatically start up again, run guard in a
## shell loop, e.g.:
##
## $ while bundle exec guard; do echo "Restarting Guard..."; done
##
## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
#
# $ mkdir config
# $ mv Guardfile config/
# $ ln -s config/Guardfile .
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"

# Note: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
# * spring: 'bin/rspec' (This will use spring if running and you have
# installed the spring binstubs per the docs)
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'

guard :rspec, cmd: "bundle exec rspec" do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)

# Feel free to open issues for suggestions and improvements

# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)

# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)

# Rails files
rails = dsl.rails(view_extensions: %w(erb haml slim))
dsl.watch_spec_files_for(rails.app_files)
dsl.watch_spec_files_for(rails.views)

watch(rails.controllers) do |m|
[
rspec.spec.("routing/#{m[1]}_routing"),
rspec.spec.("controllers/#{m[1]}_controller"),
rspec.spec.("acceptance/#{m[1]}")
]
end

# Rails config changes
watch(rails.spec_helper) { rspec.spec_dir }
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }

# Capybara features specs
watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }

# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
end
end
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ HAML wrappers for [Twitter Bootstrap](http://getbootstrap.com/2.3.2) components.
[![Build Status](https://travis-ci.org/lumoslabs/bootstrap_haml_helpers.svg)](https://travis-ci.org/lumoslabs/bootstrap_haml_helpers)
[![Gem Version](https://badge.fury.io/rb/bootstrap_haml_helpers.svg)](http://badge.fury.io/rb/bootstrap_haml_helpers)

How To Use The Components
----
```haml
= container do
woah!
= progress_bar do |pb|
= pb.bar(40)
```

Integration
----
To integrate our gem into your application, follow these steps:
Expand Down
10 changes: 5 additions & 5 deletions bootstrap_haml_helpers.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Gem::Specification.new do |s|

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

s.add_dependency "rails", "~> 3.2.12"
s.add_dependency "rails"

s.add_dependency "bootstrap-sass", "2.3.1.3"
s.add_dependency "haml", "~> 3.1.7"
s.add_dependency "sass-rails", "~> 3.2"
s.add_dependency "sass", '3.2.19'
s.add_dependency "haml"
s.add_dependency "sass-rails"
s.add_dependency "sass"

s.add_development_dependency 'sqlite3'
s.add_development_dependency 'rspec-rails', '~> 2.14'
s.add_development_dependency 'rspec-rails'
end
5 changes: 5 additions & 0 deletions lib/bootstrap_haml_helpers/component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# dummy class to enable the namespace
module BootstrapHamlHelpers
module Component
end
end
1 change: 1 addition & 0 deletions lib/bootstrap_haml_helpers/engine.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rails'
require 'bootstrap_haml_helpers/component.rb'
require 'bootstrap_haml_helpers/controller_helpers'

module BootstrapHamlHelpers
Expand Down
Loading

0 comments on commit d61c007

Please sign in to comment.