initial commit with aprox specs
This commit is contained in:
commit
457a7a35f8
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
pkg/*
|
||||
*.gem
|
||||
*.rbc
|
||||
*.swp
|
||||
.bundle
|
28
Gemfile.lock
Normal file
28
Gemfile.lock
Normal file
@ -0,0 +1,28 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
guard-rails-assets (0.0.1)
|
||||
guard
|
||||
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
diff-lcs (1.1.2)
|
||||
guard (0.4.2)
|
||||
thor (~> 0.14.6)
|
||||
rspec (2.6.0)
|
||||
rspec-core (~> 2.6.0)
|
||||
rspec-expectations (~> 2.6.0)
|
||||
rspec-mocks (~> 2.6.0)
|
||||
rspec-core (2.6.4)
|
||||
rspec-expectations (2.6.0)
|
||||
diff-lcs (~> 1.1.2)
|
||||
rspec-mocks (2.6.0)
|
||||
thor (0.14.6)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
guard-rails-assets!
|
||||
rspec
|
23
guard-rails-assets.gemspec
Normal file
23
guard-rails-assets.gemspec
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
$:.push File.expand_path("../lib", __FILE__)
|
||||
require "guard/version"
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "guard-rails-assets"
|
||||
s.version = Guard::RailsAssetsVersion::VERSION
|
||||
s.authors = ["Dmytrii Nagirniak"]
|
||||
s.email = ["dnagir@gmail.com"]
|
||||
s.homepage = "http://github.com/dnagir/guard-rails-assets"
|
||||
s.summary = %q{Guard for compiling Rails assets}
|
||||
s.description = %q{guard-rails-assets automatically generates JavaScript, CSS, Image files using Rails assets pipelie}
|
||||
|
||||
s.rubyforge_project = "guard-rails-assets"
|
||||
|
||||
s.add_dependency 'guard'
|
||||
s.add_development_dependency 'rspec'
|
||||
|
||||
s.files = `git ls-files`.split("\n")
|
||||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
||||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
||||
s.require_paths = ["lib"]
|
||||
end
|
32
lib/guard/rails-assets.rb
Normal file
32
lib/guard/rails-assets.rb
Normal file
@ -0,0 +1,32 @@
|
||||
require 'guard'
|
||||
require 'guard/guard'
|
||||
|
||||
module Guard
|
||||
class RailsAssets < Guard
|
||||
def initialize(watchers=[], options={})
|
||||
super
|
||||
end
|
||||
|
||||
def start
|
||||
# Started
|
||||
end
|
||||
|
||||
def reload
|
||||
# Ctrl-Z
|
||||
end
|
||||
|
||||
def run_all
|
||||
# Ctr-\ - restarting stuff
|
||||
end
|
||||
|
||||
def run_on_change(paths)
|
||||
end
|
||||
|
||||
def compile_assets
|
||||
# clean
|
||||
# prefix or path
|
||||
# compile
|
||||
end
|
||||
|
||||
end
|
||||
end
|
5
lib/guard/version.rb
Normal file
5
lib/guard/version.rb
Normal file
@ -0,0 +1,5 @@
|
||||
module Guard
|
||||
module RailsAssetsVersion
|
||||
VERSION = "0.0.1"
|
||||
end
|
||||
end
|
33
spec/guard/rails-assets_spec.rb
Normal file
33
spec/guard/rails-assets_spec.rb
Normal file
@ -0,0 +1,33 @@
|
||||
require 'spec_helper'
|
||||
require 'guard/rails-assets'
|
||||
|
||||
describe Guard::RailsAssets do
|
||||
let(:options) { {} }
|
||||
subject { Guard::RailsAssets.new(['watchers'], options) }
|
||||
|
||||
it 'should be able to create guard' do
|
||||
::Guard::RailsAssets.new(['watchers'], {:options=>:here}).should_not be_nil
|
||||
end
|
||||
|
||||
describe '#start' do
|
||||
it_behaves_like 'guard command', :command => :start, :run => true
|
||||
end
|
||||
|
||||
describe '#reload' do
|
||||
it_behaves_like 'guard command', :command => :reload, :run => false
|
||||
end
|
||||
|
||||
describe '#run_all' do
|
||||
it_behaves_like 'guard command', :command => :run_all, :run => true
|
||||
end
|
||||
|
||||
describe '#run_on_change' do
|
||||
it_behaves_like 'guard command', :command => :run_on_change, :run => true
|
||||
end
|
||||
|
||||
|
||||
describe 'asset compilation' do
|
||||
it 'should notify on success'
|
||||
it 'should notify on failure'
|
||||
end
|
||||
end
|
19
spec/spec_helper.rb
Normal file
19
spec/spec_helper.rb
Normal file
@ -0,0 +1,19 @@
|
||||
require 'rspec'
|
||||
require 'guard/rails-assets'
|
||||
require 'support/shared_examples'
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.color_enabled = true
|
||||
config.filter_run :focus => true
|
||||
config.run_all_when_everything_filtered = true
|
||||
|
||||
config.before(:each) do
|
||||
ENV["GUARD_ENV"] = 'test'
|
||||
@project_path = Pathname.new(File.expand_path('../../', __FILE__))
|
||||
end
|
||||
|
||||
config.after(:each) do
|
||||
ENV["GUARD_ENV"] = nil
|
||||
end
|
||||
|
||||
end
|
9
spec/support/shared_examples.rb
Normal file
9
spec/support/shared_examples.rb
Normal file
@ -0,0 +1,9 @@
|
||||
shared_examples_for "guard command" do |options|
|
||||
|
||||
it "should execute #{options[:command]} when said so"
|
||||
it "should not execute #{options[:command]} when disabled"
|
||||
|
||||
it "should #{options[:run] ? '' : 'not '}execute #{options[:command]} by default"
|
||||
it "should execute built-in helper"
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user