lazygem 0.0.1

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 +27 -0
  2. data/bin/lazygem +68 -0
  3. metadata +69 -0
data/README.rdoc ADDED
@@ -0,0 +1,27 @@
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
+
17
+ LICENSE
18
+
19
+ (The MIT License)
20
+
21
+ Copyright © 2010 Brian Scott <brainscott@gmail.com>
22
+
23
+ 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:
24
+
25
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
26
+
27
+ 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 ADDED
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/ruby
2
+
3
+ # LazyGem 0.0.1
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
+ puts "Installing #{title}"
67
+ system("sudo gem install #{title}")
68
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lazygem
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brian Scott
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-02-04 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: simple-rss
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description: Auto Installs gems that you are subscribed to on gemcutter.org.
26
+ email: brainscott@gmail.com
27
+ executables:
28
+ - lazygem
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README.rdoc
33
+ files:
34
+ - README.rdoc
35
+ has_rdoc: true
36
+ homepage: http://github.com/brainscott
37
+ licenses: []
38
+
39
+ post_install_message:
40
+ rdoc_options:
41
+ - --line-numbers
42
+ - --inline-source
43
+ - --title
44
+ - LazyGem
45
+ - --main
46
+ - README.rdoc
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
61
+ requirements: []
62
+
63
+ rubyforge_project: lazygem
64
+ rubygems_version: 1.3.5
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: Auto Installs gems that you are subscribed to on gemcutter.org. Supports MAC OS only but can be modified. Great, if you are moving to a new system and don't want to install each of your favorite gems
68
+ test_files: []
69
+