gemput 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -5
- data/lib/gemput/version.rb +1 -1
- data/lib/gemput.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a671665314caccaed7053ef5d64985ef78e1e71
|
4
|
+
data.tar.gz: 9eb0fb78e1644b1ff4b19df565898300df2e9772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e230119799f7fdf68d0b57d5a626e8338179b2140d62d83c89e744f3613ac41b3152a4135dd2a6aad50bd68855823592b46f8b69849c8ee5782a2129747c5cc
|
7
|
+
data.tar.gz: 6613e4a97ba5f87a9c55171842eb13503db28f658076b3ef8bcff63b68c686cb7fce866d74f3806dbaffbc43c29341febb41ee233f6d271495b612b4e46e8fb4
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Gemput
|
2
2
|
|
3
|
-
|
3
|
+
The easiest way to manage your Gemfile. Gemput keeps your software stable by freezing Gemfile.
|
4
4
|
|
5
|
-
|
5
|
+
##[Why do you specify gem version?](http://everydayrails.com/2012/09/11/bundler-rails-specify-versions.html)
|
6
|
+
|
7
|
+
> The Rails ecosystem moves quickly–too quickly, some might say–and as a result a given library’s API from just a few months ago may be deprecated today–or worse, it may just no longer work. Running bundle install with the Gemfile as-is, I could get gem versions that are no longer compatible with a legacy version of Rails. Or potentially worse, I could get gem versions with drastically rewritten APIsvery difficult to debug without a solid suite of tests. (The codebase in question lacks test coverage, too, but that’s a different subject.)
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -20,9 +22,30 @@ Or install it yourself as:
|
|
20
22
|
|
21
23
|
$ gem install gemput
|
22
24
|
|
23
|
-
##
|
25
|
+
## Getting Started
|
26
|
+
|
27
|
+
Add a gem along with its latest gem version in the Gemfile.
|
28
|
+
|
29
|
+
```bash
|
30
|
+
$ gemput add GEM_NAME
|
31
|
+
$ gemput a GEM_NAME
|
32
|
+
$ gemput -a GEM_NAME
|
33
|
+
```
|
34
|
+
|
35
|
+
Fill out the missing gem versions in the Gemfile.
|
36
|
+
|
37
|
+
```bash
|
38
|
+
$ gemput sync
|
39
|
+
$ gemput s
|
40
|
+
$ gemput -s
|
41
|
+
```
|
24
42
|
|
25
|
-
|
43
|
+
View command helps.
|
44
|
+
```bash
|
45
|
+
$ gemput help
|
46
|
+
$ gemput h
|
47
|
+
$ gemput -h
|
48
|
+
```
|
26
49
|
|
27
50
|
## Development
|
28
51
|
|
@@ -32,7 +55,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
55
|
|
33
56
|
## Contributing
|
34
57
|
|
35
|
-
1. Fork it ( https://github.com/
|
58
|
+
1. Fork it ( https://github.com/stompesi/gemput/fork )
|
36
59
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
60
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
61
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/gemput/version.rb
CHANGED
data/lib/gemput.rb
CHANGED
@@ -21,11 +21,13 @@ module Gemput
|
|
21
21
|
return
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
lines = File.open(filename).to_a
|
25
|
+
|
25
26
|
|
26
27
|
unless gem_info['name'].nil?
|
27
28
|
open('Gemfile', 'a') { |f|
|
28
|
-
f.
|
29
|
+
f.sub(/\s+\Z/, "")
|
30
|
+
f.puts "\ngem '#{gem_info['name']}', '~> #{gem_info['version']}'"
|
29
31
|
puts ''
|
30
32
|
puts " '#{gem_info['name']}' gem added."
|
31
33
|
puts ''
|
@@ -49,12 +51,12 @@ module Gemput
|
|
49
51
|
puts ''
|
50
52
|
puts '# gem version synchronizing start.'
|
51
53
|
read_text.each_line do |line|
|
52
|
-
gem_line = /^\s*gem '([^']*)'\s*$/.match(line)
|
54
|
+
gem_line = /^\s*gem ['"]([^']*)['"]\s*$/.match(line)
|
53
55
|
unless gem_line.nil?
|
54
56
|
name = gem_line.captures[0]
|
55
57
|
gem_info = Gems.info(name)
|
56
58
|
gem_version = gem_info['version']
|
57
|
-
write_text << line.
|
59
|
+
write_text << line.sub(/\s+\Z/, "") << ", '~> " << gem_version << "'\n"
|
58
60
|
puts " - '#{name}' gem version added."
|
59
61
|
else
|
60
62
|
write_text << line
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemput
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stompesi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-04-
|
12
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|