Skip to content

Commit 2930f18

Browse files
committed
travis CI integration
* isolate Jammit::VERSION into single file (easy to require) * remove redgreen from Rakefile (contentious?) * remove -rrubygems from bin/jammit - use inline require * use `bundle exec` path in tests
1 parent 1a6db78 commit 2930f18

File tree

7 files changed

+19
-13
lines changed

7 files changed

+19
-13
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: ruby
2+
rvm:
3+
- "1.8.7"
4+
- "1.9.2"
5+
- "1.9.3"

Rakefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ task :test, [:path] do |task, args|
55
ENV['RAILS_ENV'] = 'test'
66
$LOAD_PATH.unshift(File.expand_path('test'))
77

8-
require 'redgreen'
9-
108
if args[:path]
119
require args[:path]
1210
else

bin/jammit

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#!/usr/bin/env ruby -rrubygems
1+
#!/usr/bin/env ruby
2+
require 'rubygems'
23
require 'pathname'
34

45
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
56
require File.join(APP_ROOT, '../lib/jammit/command_line.rb')
67

7-
Jammit::CommandLine.new
8+
Jammit::CommandLine.new

jammit.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
lib = File.expand_path('../lib/', __FILE__)
22
$:.unshift lib unless $:.include?(lib)
33

4-
require 'jammit'
4+
require 'jammit/version'
55

66
Gem::Specification.new do |s|
77
s.name = 'jammit'

lib/jammit.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# to all of the configuration options.
55
module Jammit
66

7-
VERSION = "0.6.5"
8-
97
ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
108

119
ASSET_ROOT = File.expand_path((defined?(Rails) && Rails.root.to_s.length > 0) ? Rails.root : ENV['RAILS_ROOT'] || ".") unless defined?(ASSET_ROOT)

lib/jammit/version.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Jammit
2+
VERSION = "0.6.5"
3+
end

test/integration/test_command_line.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require 'zlib'
33

44
class CommandLineTest < Test::Unit::TestCase
5+
JAMMIT = "bundle exec bin/jammit"
56

67
def setup
78
ENV['RAILS_ROOT'] = 'test'
@@ -15,12 +16,12 @@ def teardown
1516
end
1617

1718
def test_version_and_help_can_run
18-
assert system('bin/jammit -v > /dev/null')
19-
assert system('bin/jammit -h > /dev/null')
19+
assert system("#{ JAMMIT } -v > /dev/null")
20+
assert system("#{ JAMMIT } -h > /dev/null")
2021
end
2122

2223
def test_jammit_precaching
23-
system('bin/jammit -c test/config/assets.yml -o test/precache -u http://www.example.com')
24+
system("#{ JAMMIT } -c test/config/assets.yml -o test/precache -u http://www.example.com")
2425
assert_equal PRECACHED_FILES, glob('test/precache/*')
2526

2627
assert_equal zlib_read('test/precache/css_test-datauri.css.gz'),
@@ -34,12 +35,12 @@ def test_jammit_precaching
3435
end
3536

3637
def test_lazy_precaching
37-
system('bin/jammit -c test/config/assets.yml -o test/precache -u http://www.example.com')
38+
system("#{ JAMMIT } -c test/config/assets.yml -o test/precache -u http://www.example.com")
3839
assert_equal PRECACHED_FILES, glob('test/precache/*')
3940
mtime = File.mtime(PRECACHED_FILES.first)
40-
system('bin/jammit -c test/config/assets.yml -o test/precache -u http://www.example.com')
41+
system("#{ JAMMIT } -c test/config/assets.yml -o test/precache -u http://www.example.com")
4142
assert_equal File.mtime(PRECACHED_FILES.first), mtime
42-
system('bin/jammit -c test/config/assets.yml -o test/precache -u http://www.example.com --force')
43+
system("#{ JAMMIT } -c test/config/assets.yml -o test/precache -u http://www.example.com --force")
4344
assert File.mtime(PRECACHED_FILES.first) > mtime
4445
end
4546

0 commit comments

Comments
 (0)