railslove-cli 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,24 +1,35 @@
1
- # Railslove::Cli
1
+ # The Railslove CLI
2
2
 
3
- TODO: Write a gem description
3
+ This is a little CLI wrapper for [api.railslove.com](http://api.railslove.com) that also powers [railslove.com](http://railslove.com). Now you can access (all) the Railslove content directly from your shell prompt.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Install it yourself as:
8
8
 
9
- gem 'railslove-cli'
9
+ $ gem install railslove-cli
10
10
 
11
- And then execute:
11
+ ## Usage
12
12
 
13
- $ bundle
13
+ ### People
14
14
 
15
- Or install it yourself as:
15
+ You can get a list of all the folks of the Railslove Family
16
16
 
17
- $ gem install railslove-cli
17
+ $ railslove-people list
18
18
 
19
- ## Usage
19
+ Once you found someone you're more interested in you can obtaim more information with:
20
+
21
+ $ railslove-people show <slug>
22
+
23
+ ### Projects
24
+
25
+ You can get a list of all projects where Railslove was somehow involved
26
+
27
+ $ railslove-projects list
28
+
29
+ Once you found someone you're more interested in you can obtaim more information with:
30
+
31
+ $ railslove-projects show <slug>
20
32
 
21
- TODO: Write usage instructions here
22
33
 
23
34
  ## Contributing
24
35
 
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require "railslove-cli"
5
+ rescue LoadError
6
+ railslove_cli_path = File.expand_path('../../lib', __FILE__)
7
+ $:.unshift(railslove_cli_path)
8
+ require "railslove-cli"
9
+ end
10
+
11
+ Railslove::Cli::Project.start(ARGV)
data/lib/railslove-cli.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "railslove-cli/version"
2
+ require "railslove-cli/project"
2
3
  require "railslove-cli/people"
3
4
 
4
5
  module Railslove
@@ -0,0 +1,40 @@
1
+ require "thor"
2
+ require "httparty"
3
+
4
+ module Railslove
5
+ module Cli
6
+ class Project < Thor
7
+
8
+ desc "list", "gives you all information about the team members"
9
+ def list
10
+ projects = HTTParty.get("http://api.railslove.com/projects.json")
11
+
12
+ printf(" %-28s %-33s %-15s\n", "slug", "name", "project_type")
13
+ puts "-"*77
14
+ projects["projects"].each do |project|
15
+ printf(" %-28s %-33s %-15s\n", project["project"]["slug"], project["project"]["name"], project["project"]["project_type"])
16
+ end
17
+ puts "-"*77
18
+ end
19
+
20
+ desc "show SLUG", "view more details about a single project"
21
+ def show(slug)
22
+ project = HTTParty.get("http://api.railslove.com/projects/#{slug}.json")
23
+
24
+ people = project["project"].delete("people")
25
+ images = project["project"].delete("images")
26
+ links = project["project"].delete("links")
27
+ description = project["project"].delete("description")
28
+
29
+ puts "#{description}\n\n"
30
+ project["project"].each do |k,v|
31
+ printf("%14s: %s\n", k, v)
32
+ end
33
+
34
+ end
35
+
36
+ end
37
+ end
38
+ end
39
+
40
+
@@ -1,5 +1,5 @@
1
1
  module Railslove
2
2
  module Cli
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railslove-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-31 00:00:00.000000000 Z
12
+ date: 2012-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70293405036460 !ruby/object:Gem::Requirement
16
+ requirement: &70284699274060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70293405036460
24
+ version_requirements: *70284699274060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: httparty
27
- requirement: &70293405036040 !ruby/object:Gem::Requirement
27
+ requirement: &70284699273460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70293405036040
35
+ version_requirements: *70284699273460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70293405035540 !ruby/object:Gem::Requirement
38
+ requirement: &70284699272960 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,12 +43,13 @@ dependencies:
43
43
  version: 0.8.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70293405035540
46
+ version_requirements: *70284699272960
47
47
  description: a nice cli for the railslove public api
48
48
  email:
49
49
  - lars@railslove.com
50
50
  executables:
51
51
  - railslove-people
52
+ - railslove-projects
52
53
  extensions: []
53
54
  extra_rdoc_files: []
54
55
  files:
@@ -58,8 +59,10 @@ files:
58
59
  - README.md
59
60
  - Rakefile
60
61
  - bin/railslove-people
62
+ - bin/railslove-projects
61
63
  - lib/railslove-cli.rb
62
64
  - lib/railslove-cli/people.rb
65
+ - lib/railslove-cli/project.rb
63
66
  - lib/railslove-cli/version.rb
64
67
  - railslove-cli.gemspec
65
68
  homepage: http://railslove.com
@@ -76,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
79
  version: '0'
77
80
  segments:
78
81
  - 0
79
- hash: -976793327258209735
82
+ hash: -1501823932728567781
80
83
  required_rubygems_version: !ruby/object:Gem::Requirement
81
84
  none: false
82
85
  requirements:
@@ -85,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
88
  version: '0'
86
89
  segments:
87
90
  - 0
88
- hash: -976793327258209735
91
+ hash: -1501823932728567781
89
92
  requirements: []
90
93
  rubyforge_project:
91
94
  rubygems_version: 1.8.15