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 +4 -4
- data/.travis.yml +8 -0
- data/README.md +2 -0
- data/Rakefile +10 -0
- data/lib/shoestring/cache.rb +11 -2
- data/lib/shoestring/homebrew.rb +1 -2
- data/lib/shoestring/version.rb +1 -1
- data/shoestring.gemspec +2 -0
- data/spec/cache_spec.rb +51 -0
- data/spec/spec_helper.rb +4 -0
- metadata +37 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1084f8f9564835f8c0ec3f8d62d6ff1d8ead27fd
|
4
|
+
data.tar.gz: fc9feef4d9d8164ece79f7314a78a00df49598c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5c87bc7f048abd3847bcf3ce2375166531cc59f95f4ac3b75ad80932ee85bc8067e737e4fb07a41b98f2c5a76fef102af2c06e44a612475917417d9713bc9cc
|
7
|
+
data.tar.gz: ccff0e2c55df8e9667f3ce0179df5f442248a3c92b7fa6dd835932ffcb6707728118f3937e2a05fda5eb3f8e5c1997b6f643cc10885a897703ca23c5a9dd000e
|
data/.travis.yml
ADDED
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
data/lib/shoestring/cache.rb
CHANGED
@@ -9,12 +9,21 @@ module Shoestring
|
|
9
9
|
|
10
10
|
def check
|
11
11
|
version = block.call(old_version)
|
12
|
-
|
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
|
-
"
|
22
|
+
"#{cache_directory}/.#{key}"
|
23
|
+
end
|
24
|
+
|
25
|
+
def cache_directory
|
26
|
+
'tmp'
|
18
27
|
end
|
19
28
|
|
20
29
|
def old_version
|
data/lib/shoestring/homebrew.rb
CHANGED
data/lib/shoestring/version.rb
CHANGED
data/shoestring.gemspec
CHANGED
data/spec/cache_spec.rb
ADDED
@@ -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
|
data/spec/spec_helper.rb
ADDED
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.
|
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-
|
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.
|
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
|
-
|
136
|
+
test_files:
|
137
|
+
- spec/cache_spec.rb
|
138
|
+
- spec/spec_helper.rb
|