trump 0.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Trump
2
2
 
3
- Add a gem to the Gemfile with more info in comments.
3
+ Add a gem to the Gemfile with more info in comments. This will not add it directly met add it to your clipboard, so you can easily past it where you want inside your Gemfile.
4
4
 
5
5
  Below is an example of the output in the Gemfile:
6
6
 
@@ -8,6 +8,8 @@ Below is an example of the output in the Gemfile:
8
8
  # [gemname](http://gemurl.com)
9
9
  gem "gemname", "0.0.1"
10
10
 
11
+ Credits for this gem go to [@junkiesxl](http://twitter.com/junkiesxl), he created an emacs function to do this. But I use Vim so... I created a gem for it!
12
+
11
13
  ## Installation
12
14
 
13
15
  Install the gem:
@@ -23,18 +25,14 @@ There is only one command and this is explained below.
23
25
  Run the following command followed by the name of the gem.
24
26
 
25
27
  trump gemname
26
- trump add gemname
27
28
 
28
29
  Both commands are the same.
29
30
 
30
- Now check out your Gemfile and look at the info added to the gem.
31
+ Now open your Gemfile and paste the content of you clipboard. It's that simple!
31
32
 
32
33
  ## TODO
33
34
 
34
- - Edit an existing gem
35
- - Choose the version number
36
- - Remove a gem
37
- - Add a gem in the development group
35
+ - Choose the git version
38
36
 
39
37
  ## Contributing
40
38
 
data/bin/trump CHANGED
@@ -12,8 +12,4 @@ class TrumpCommand < Thor
12
12
  end
13
13
  end
14
14
 
15
- if ARGV[0] == "add"
16
- TrumpCommand.start
17
- else
18
- TrumpCommand.new.add(ARGV[0])
19
- end
15
+ TrumpCommand.new.add(ARGV[0])
@@ -1,4 +1,5 @@
1
1
  require "curl_wrapper"
2
+ require "clipboard"
2
3
  require "json/pure"
3
4
 
4
5
  module Trump
@@ -26,18 +27,15 @@ module Trump
26
27
  your_gem = JSON.parse(content)
27
28
  url = your_gem["homepage_uri"] || your_gem["documentation_uri"]
28
29
 
29
- puts_text("Detecting Gemfile")
30
- if File.exists?("Gemfile")
31
- File.open("Gemfile", 'a') do |file|
32
- file.puts ""
33
- file.puts "# #{your_gem["info"][0..75]}"
34
- file.puts "# [#{name}](#{url})"
35
- file.puts "gem \"#{name}\", \"#{your_gem["version"]}\""
36
- end
37
- puts_text("Adding gem '#{name}' to the Gemfile.")
38
- else
39
- puts_text("There is no Gemfile available in this directory.")
40
- end
30
+
31
+ text = "# #{your_gem["info"][0..75]}\n"
32
+ text += "# [#{name}](#{url})\n"
33
+ text += "gem \"#{name}\", \"~> #{your_gem["version"]}\""
34
+ Clipboard.copy text
35
+
36
+ puts_text("Copied gem '#{name}' data to your clipboard.")
37
+ puts_text("")
38
+ puts_text("Now open the Gemfile and paste along!")
41
39
  puts_text("")
42
40
  puts end_text
43
41
  end
@@ -1,3 +1,3 @@
1
1
  module Trump
2
- VERSION = "0.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency 'thor', '0.18.1'
24
24
  spec.add_dependency "json_pure", "~> 1.8.0"
25
25
  spec.add_dependency "curl_wrapper", "~> 0.0.3"
26
+ spec.add_dependency "clipboard", "~> 1.0.5"
26
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trump
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-23 00:00:00.000000000 Z
12
+ date: 2013-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -91,6 +91,22 @@ dependencies:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
93
  version: 0.0.3
94
+ - !ruby/object:Gem::Dependency
95
+ name: clipboard
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 1.0.5
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.5
94
110
  description: Add a gem to the Gemfile with more info in comments.
95
111
  email:
96
112
  - jelle@fousa.be