lazygem 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +30 -31
  2. data/bin/lazygem +77 -77
  3. metadata +1 -1
data/README.rdoc CHANGED
@@ -1,32 +1,31 @@
1
- LazyGem
2
-
3
- LazyGem looks at your ATOM feed in your gemcutter profile and auto installs any gems that you are currently subscribed too.
4
- Very useful if you move to a new station. Lazygem requires that you have your credentials file setup according to your http://gemcutter.org/profile page.
5
- This file is used to pull your api_key to retrieve your ATOM feed.
6
-
7
- INSTALL:
8
-
9
- sudo gem install lazygem
10
-
11
- Requirements:
12
-
13
- Ruby (Developed on 1.8.7)
14
- RubyGems (Developed on 1.3.5)
15
-
16
- TODO:
17
-
18
- 1) Add platform detection.
19
- 2) Check to see if a gem is already installed.
20
- 3) Need to add tests.
21
-
22
- LICENSE
23
-
24
- (The MIT License)
25
-
26
- Copyright © 2010 Brian Scott <brainscott@gmail.com>
27
-
28
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
29
-
30
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
31
-
1
+ LazyGem
2
+
3
+ LazyGem looks at your ATOM feed in your gemcutter profile and auto installs any gems that you are currently subscribed too.
4
+ Very useful if you move to a new station. Lazygem requires that you have your credentials file setup according to your http://gemcutter.org/profile page.
5
+ This file is used to pull your api_key to retrieve your ATOM feed.
6
+
7
+ INSTALL:
8
+
9
+ sudo gem install lazygem
10
+
11
+ Requirements:
12
+
13
+ Ruby (Developed on 1.8.7)
14
+ RubyGems (Developed on 1.3.5)
15
+
16
+ TODO:
17
+
18
+ 1) Check to see if a gem from the subscribed feed is already installed.
19
+ 2) Need to add tests.
20
+
21
+ LICENSE
22
+
23
+ (The MIT License)
24
+
25
+ Copyright © 2010 Brian Scott <brainscott@gmail.com>
26
+
27
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
28
+
29
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
30
+
32
31
  THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/bin/lazygem CHANGED
@@ -1,77 +1,77 @@
1
- #!/usr/bin/ruby
2
-
3
- # LazyGem 0.0.2
4
- # Author: Brian Scott
5
- #
6
- # Copyright (c) 2010 Brian Scott <brainscott@gmail.com>
7
- #
8
- # Permission is hereby granted, free of charge, to any person obtaining
9
- # a copy of this software and associated documentation files (the
10
- # "Software"), to deal in the Software without restriction, including
11
- # without limitation the rights to use, copy, modify, merge, publish,
12
- # distribute, sublicense, and/or sell copies of the Software, and to
13
- # permit persons to whom the Software is furnished to do so, subject to
14
- # the following conditions:
15
- #
16
- # The above copyright notice and this permission notice shall be
17
- # included in all copies or substantial portions of the Software.
18
- #
19
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
-
27
-
28
- $:.unshift File.dirname(__FILE__)
29
-
30
- require 'rubygems'
31
- require 'simple-rss'
32
- require 'open-uri'
33
-
34
- # Local Variables
35
- rUrl = "http://gemcutter.org/dashboard.atom?api_key="
36
- titles = Array.new
37
-
38
- # Grabing API key from local credentials file
39
- def read_file ()
40
- data = ""
41
- temp = File.open("#{ENV['HOME']}/.gem/credentials", 'r')
42
- temp.each_line do |line|
43
- data += line
44
- end
45
- return data
46
- end
47
-
48
- # Cleaning up file
49
- api_key = read_file
50
- api_key = api_key.split(/\:\w+\: (.+)/)[1]
51
-
52
- puts "Retrieving ATOM feed from Gemcutter.org"
53
- atom = SimpleRSS.parse open(rUrl + api_key)
54
- # parsing ATOM feed for gem titles
55
- atom.entries.each do |entry|
56
- title = entry.title
57
- title = title.gsub(/ \(.*/, "")
58
- titles.push(title)
59
- end
60
-
61
- # Cleaning up ATOM duplicate entries
62
- titlesAry = titles.uniq!
63
-
64
- # Installing subscribed gems
65
- titlesAry.each do |title|
66
-
67
- puts "Installing #{title}"
68
-
69
- if RUBY_PLATFORM =~ /mswin32/
70
-
71
- system("gem install #{title}")
72
-
73
- else system("sudo gem install #{title}")
74
-
75
- end
76
- end
77
-
1
+ #!/usr/bin/ruby
2
+
3
+ # LazyGem 0.0.3
4
+ # Author: Brian Scott
5
+ #
6
+ # Copyright (c) 2010 Brian Scott <brainscott@gmail.com>
7
+ #
8
+ # Permission is hereby granted, free of charge, to any person obtaining
9
+ # a copy of this software and associated documentation files (the
10
+ # "Software"), to deal in the Software without restriction, including
11
+ # without limitation the rights to use, copy, modify, merge, publish,
12
+ # distribute, sublicense, and/or sell copies of the Software, and to
13
+ # permit persons to whom the Software is furnished to do so, subject to
14
+ # the following conditions:
15
+ #
16
+ # The above copyright notice and this permission notice shall be
17
+ # included in all copies or substantial portions of the Software.
18
+ #
19
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+
27
+
28
+ $:.unshift File.dirname(__FILE__)
29
+
30
+ require 'rubygems'
31
+ require 'simple-rss'
32
+ require 'open-uri'
33
+
34
+ # Local Variables
35
+ rUrl = "http://gemcutter.org/dashboard.atom?api_key="
36
+ titles = Array.new
37
+
38
+ # Grabing API key from local credentials file
39
+ def read_file ()
40
+ data = ""
41
+ temp = File.open("#{ENV['HOME']}/.gem/credentials", 'r')
42
+ temp.each_line do |line|
43
+ data += line
44
+ end
45
+ return data
46
+ end
47
+
48
+ # Cleaning up file
49
+ api_key = read_file
50
+ api_key = api_key.split(/\:\w+\: (.+)/)[1]
51
+
52
+ puts "Retrieving ATOM feed from Gemcutter.org"
53
+ atom = SimpleRSS.parse open(rUrl + api_key)
54
+ # parsing ATOM feed for gem titles
55
+ atom.entries.each do |entry|
56
+ title = entry.title
57
+ title = title.gsub(/ \(.*/, "")
58
+ titles.push(title)
59
+ end
60
+
61
+ # Cleaning up ATOM duplicate entries
62
+ titlesAry = titles.uniq!
63
+
64
+ # Installing subscribed gems
65
+ titlesAry.each do |title|
66
+
67
+ puts "Installing #{title}"
68
+
69
+ if RUBY_PLATFORM =~ /mingw/
70
+
71
+ system("gem install #{title}")
72
+
73
+ else system("sudo gem install #{title}")
74
+
75
+ end
76
+ end
77
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazygem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Scott