shoestring 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db5adf36137870e5087988dd30f3c17f350342fa
4
- data.tar.gz: 8744673f440865d611aefcebd2c47d8db4c55896
3
+ metadata.gz: 1084f8f9564835f8c0ec3f8d62d6ff1d8ead27fd
4
+ data.tar.gz: fc9feef4d9d8164ece79f7314a78a00df49598c9
5
5
  SHA512:
6
- metadata.gz: e25ae2e5dafdec4b2773df37bd4ae5acbb2f948074cf827b480c7c10f61d1038f7ae453b9178843a379237535b28686ce5f696e11c56a7a1193f1afb7090c1b9
7
- data.tar.gz: d7a6002e24d4ea26a28a82e66b53889b217c3bc1af5d47a3738a695f927a2c3359dd7e200f55ee4ec7c0cb51dcc51a80cf0372b8a96fadf2e33e5e28ef336185
6
+ metadata.gz: d5c87bc7f048abd3847bcf3ce2375166531cc59f95f4ac3b75ad80932ee85bc8067e737e4fb07a41b98f2c5a76fef102af2c06e44a612475917417d9713bc9cc
7
+ data.tar.gz: ccff0e2c55df8e9667f3ce0179df5f442248a3c92b7fa6dd835932ffcb6707728118f3937e2a05fda5eb3f8e5c1997b6f643cc10885a897703ca23c5a9dd000e
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 1.9.2
5
+ - jruby-19mode
6
+ - rbx-2.1.1
7
+ - ruby-head
8
+ - jruby-head
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  [![Code Climate](https://codeclimate.com/github/calebwoods/shoestring.png)](https://codeclimate.com/github/calebwoods/shoestring)
2
2
 
3
+ [![Build Status](https://travis-ci.org/calebwoods/shoestring.png?branch=master)](https://travis-ci.org/calebwoods/shoestring)
4
+
3
5
  # Shoestring
4
6
 
5
7
  Automate setting up Rails development environment including external dependencies.
data/Rakefile CHANGED
@@ -1 +1,11 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rake/testtask'
3
+
4
+ desc 'Default Raketask'
5
+ task :default do
6
+ Rake::Task['test'].invoke
7
+ end
8
+
9
+ Rake::TestTask.new do |t|
10
+ t.pattern = "spec/*_spec.rb"
11
+ end
@@ -9,12 +9,21 @@ module Shoestring
9
9
 
10
10
  def check
11
11
  version = block.call(old_version)
12
- File.open(cache_file, 'w') { |f| f.puts(version || 'cached') }
12
+ write_version(version)
13
13
  end
14
14
 
15
15
  private
16
+ def write_version(version)
17
+ FileUtils.mkdir_p(cache_directory)
18
+ File.open(cache_file, 'w') { |f| f.puts(version || 'cached') }
19
+ end
20
+
16
21
  def cache_file
17
- "tmp/.#{key}"
22
+ "#{cache_directory}/.#{key}"
23
+ end
24
+
25
+ def cache_directory
26
+ 'tmp'
18
27
  end
19
28
 
20
29
  def old_version
@@ -15,8 +15,7 @@ module Shoestring
15
15
  else
16
16
  puts "You need to setup #{name} #{url}"
17
17
 
18
- homebrew_installed = %x(brew -v)
19
- if homebrew_installed
18
+ if system('brew -v')
20
19
  install_with_homebrew
21
20
  else
22
21
  install_homebrew
@@ -1,3 +1,3 @@
1
1
  module Shoestring
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -22,4 +22,6 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "pry"
26
+ spec.add_development_dependency "minitest", "~> 5.0.8"
25
27
  end
@@ -0,0 +1,51 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe Shoestring::Cache do
4
+
5
+ describe "caches to file" do
6
+ before { FileUtils.rm_rf('tmp') }
7
+
8
+ it "works when tmp folder doesn't exist" do
9
+ Shoestring::Cache.check(:test) do |old_version|
10
+ 'cached_value'
11
+ end
12
+
13
+ File.exists?('tmp/.test').must_equal true
14
+ end
15
+
16
+ it "doesn't run when cache is the same" do
17
+ Shoestring::Cache.check(:test) do |old_version|
18
+ @called = 1
19
+ 'cached_value'
20
+ end
21
+
22
+ Shoestring::Cache.check(:test) do |old_version|
23
+ version = 'cached_value'
24
+ if version != old_version.strip
25
+ @called = 2
26
+ end
27
+ version
28
+ end
29
+
30
+ @called.must_equal 1
31
+ end
32
+
33
+ it "reruns when version does not match cache" do
34
+ Shoestring::Cache.check(:test) do |old_version|
35
+ @called = 1
36
+ 'cached_value'
37
+ end
38
+
39
+ Shoestring::Cache.check(:test) do |old_version|
40
+ version = 'changed_value'
41
+ if version != old_version.strip
42
+ @called = 2
43
+ end
44
+ version
45
+ end
46
+
47
+ @called.must_equal 2
48
+ end
49
+ end
50
+
51
+ end
@@ -0,0 +1,4 @@
1
+ require 'minitest/autorun'
2
+ require 'minitest/spec'
3
+ require 'pry'
4
+ require_relative '../lib/shoestring'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoestring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Woods
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-10 00:00:00.000000000 Z
11
+ date: 2013-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: powder
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 5.0.8
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 5.0.8
55
83
  description: Helps you manage development dependencies for your Rails app
56
84
  email:
57
85
  - calebawoods@gmail.com
@@ -60,6 +88,7 @@ extensions: []
60
88
  extra_rdoc_files: []
61
89
  files:
62
90
  - .gitignore
91
+ - .travis.yml
63
92
  - Gemfile
64
93
  - LICENSE.txt
65
94
  - README.md
@@ -78,6 +107,8 @@ files:
78
107
  - lib/shoestring/server.rb
79
108
  - lib/shoestring/version.rb
80
109
  - shoestring.gemspec
110
+ - spec/cache_spec.rb
111
+ - spec/spec_helper.rb
81
112
  homepage: http://rolemodelsoftware.com
82
113
  licenses:
83
114
  - MIT
@@ -98,9 +129,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
129
  version: '0'
99
130
  requirements: []
100
131
  rubyforge_project:
101
- rubygems_version: 2.0.2
132
+ rubygems_version: 2.0.3
102
133
  signing_key:
103
134
  specification_version: 4
104
135
  summary: See Github page for examples
105
- test_files: []
106
- has_rdoc:
136
+ test_files:
137
+ - spec/cache_spec.rb
138
+ - spec/spec_helper.rb