meme_generator 1.2.2 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +9 -0
  3. data/Rakefile +0 -2
  4. data/lib/meme.rb +22 -2
  5. metadata +8 -9
  6. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,12 @@
1
+ === 1.3 / 2011-03-10
2
+
3
+ * Minor enhancements
4
+ * Added Scumbag Steve. Pull Request #9 by Aaron Patterson
5
+ * <tt>meme > foo.jpg</tt> will download the generated image. Pull Request
6
+ #9 by Aaron Patterson
7
+ * Added Most Interesting Man in the World and Courage Wolf. Pull Request
8
+ #10 by postmodern.
9
+
1
10
  === 1.2.2 / 2011-02-22
2
11
 
3
12
  * Bug Fix
data/Rakefile CHANGED
@@ -12,8 +12,6 @@ Hoe.spec 'meme_generator' do
12
12
  'docs.seattlerb.org:/data/www/docs.seattlerb.org/meme_generator/'
13
13
 
14
14
  extra_deps << ['nokogiri', '~> 1.4']
15
-
16
- required_ruby_version = '>= 1.9.2'
17
15
  end
18
16
 
19
17
  # vim: syntax=ruby
@@ -16,7 +16,7 @@ class Meme
16
16
  ##
17
17
  # Every meme generator needs a version
18
18
 
19
- VERSION = '1.2.2'
19
+ VERSION = '1.3'
20
20
 
21
21
  ##
22
22
  # For statistics!
@@ -35,6 +35,7 @@ class Meme
35
35
  GENERATORS['B_FROG2'] = [1045, 'Foul-Bachelor-Frog']
36
36
  GENERATORS['PHILOSORAPTOR'] = [984, 'Philosoraptor']
37
37
  GENERATORS['I_WOLF'] = [926, 'Insanity-Wolf']
38
+ GENERATORS['C_WOLF'] = [931, 'Courage-Wolf']
38
39
  GENERATORS['G_GRANDPA'] = [185650, 'Grumpy-Grandpa']
39
40
  GENERATORS['S_AWKWARD_PENGUIN'] = [983, 'Socially-Awkward-Penguin']
40
41
  GENERATORS['A_DOG'] = [940, 'Advice-Dog']
@@ -47,6 +48,8 @@ class Meme
47
48
  GENERATORS['SPARTA'] = [1013, 'sparta']
48
49
  GENERATORS['TOWNCRIER'] = [434537, 'Towncrier']
49
50
  GENERATORS['H_MERMAID'] = [405224, 'Hipster-Mermaid']
51
+ GENERATORS['SCUMBAG'] = [364688, 'Scumbag-Steve']
52
+ GENERATORS['I_DONT_ALWAYS'] = [38926, 'The-Most-Interesting-Man-in-the-World']
50
53
 
51
54
  ##
52
55
  # Looks up generator name
@@ -85,7 +88,11 @@ class Meme
85
88
 
86
89
  meme.paste link
87
90
 
88
- puts link
91
+ if $stdout.tty?
92
+ puts link
93
+ else
94
+ puts meme.fetch link
95
+ end
89
96
  link
90
97
  rescue Interrupt
91
98
  exit
@@ -143,6 +150,19 @@ class Meme
143
150
  doc.css("a[href=\"#{location}\"] img").first['src']
144
151
  end
145
152
 
153
+ def fetch link
154
+ url = URI.parse link
155
+ res = nil
156
+
157
+ Net::HTTP.start url.host do |http|
158
+ get = Net::HTTP::Get.new url.request_uri
159
+ get['User-Agent'] = USER_AGENT
160
+
161
+ res = http.request get
162
+ end
163
+ res.body
164
+ end
165
+
146
166
  ##
147
167
  # Tries to find clipboard copy executable and if found puts +link+ in your
148
168
  # clipboard.
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meme_generator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
9
- - 2
10
- version: 1.2.2
8
+ - 3
9
+ version: "1.3"
11
10
  platform: ruby
12
11
  authors:
13
12
  - Eric Hodel
@@ -36,7 +35,7 @@ cert_chain:
36
35
  x52qPcexcYZR7w==
37
36
  -----END CERTIFICATE-----
38
37
 
39
- date: 2011-02-23 00:00:00 -08:00
38
+ date: 2011-03-10 00:00:00 -08:00
40
39
  default_executable:
41
40
  dependencies:
42
41
  - !ruby/object:Gem::Dependency
@@ -62,12 +61,12 @@ dependencies:
62
61
  requirements:
63
62
  - - ">="
64
63
  - !ruby/object:Gem::Version
65
- hash: 43
64
+ hash: 41
66
65
  segments:
67
66
  - 2
68
67
  - 9
69
- - 0
70
- version: 2.9.0
68
+ - 1
69
+ version: 2.9.1
71
70
  type: :development
72
71
  version_requirements: *id002
73
72
  description: Generate meme images using http://memegenerator.net! Save yourself some time!
@@ -119,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
118
  requirements: []
120
119
 
121
120
  rubyforge_project: meme_generator
122
- rubygems_version: 1.5.2
121
+ rubygems_version: 1.6.2
123
122
  signing_key:
124
123
  specification_version: 3
125
124
  summary: Generate meme images using http://memegenerator.net! Save yourself some time!
metadata.gz.sig CHANGED
Binary file