geppetto 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/geppetto/320_240.png +0 -0
- data/lib/geppetto/cli.rb +2 -16
- data/lib/geppetto/version.rb +1 -1
- metadata +4 -17
Binary file
|
data/lib/geppetto/cli.rb
CHANGED
@@ -3,7 +3,6 @@ require 'koala'
|
|
3
3
|
require 'ostruct'
|
4
4
|
require 'yaml'
|
5
5
|
require 'progressbar'
|
6
|
-
require 'rmagick'
|
7
6
|
require 'tempfile'
|
8
7
|
|
9
8
|
module Geppetto
|
@@ -156,14 +155,8 @@ module Geppetto
|
|
156
155
|
users_hash.each{|user_hash|
|
157
156
|
# Get this user's feed
|
158
157
|
@graph = Facebook::GraphAPI.new(get_token_for_user_id(user_hash['id']))
|
159
|
-
|
160
|
-
|
161
|
-
create_image(file.path)
|
162
|
-
@graph.put_picture(file.path, 'image/jpeg', {:message => "Image created at #{Time.now}"})
|
163
|
-
ensure
|
164
|
-
file.close
|
165
|
-
file.unlink
|
166
|
-
end
|
158
|
+
file_path = File.join(File.dirname(__FILE__), '320_240.png')
|
159
|
+
@graph.put_picture(file_path, 'image/png', {:message => "Image created at #{Time.now}"})
|
167
160
|
progress.inc
|
168
161
|
}
|
169
162
|
progress.finish
|
@@ -220,13 +213,6 @@ module Geppetto
|
|
220
213
|
def get_token_for_user_id(user_id)
|
221
214
|
return get_user_hash(user_id)['access_token']
|
222
215
|
end
|
223
|
-
|
224
|
-
# Crate an image containing text
|
225
|
-
def create_image(file)
|
226
|
-
image = Magick::Image.new(320, 240, Magick::HatchFill.new("##{'%02X' % rand(255)}#{'%02X' % rand(255)}#{'%02X' % rand(255)}"))
|
227
|
-
image.format = "jpg"
|
228
|
-
image.write(file)
|
229
|
-
end
|
230
216
|
|
231
217
|
def create_users(nb, connected, networked, permissions)
|
232
218
|
if networked
|
data/lib/geppetto/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geppetto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 4
|
10
|
+
version: 0.9.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Georges Auberger
|
@@ -64,20 +64,6 @@ dependencies:
|
|
64
64
|
version: "0"
|
65
65
|
type: :runtime
|
66
66
|
version_requirements: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: rmagick
|
69
|
-
prerelease: false
|
70
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
hash: 3
|
76
|
-
segments:
|
77
|
-
- 0
|
78
|
-
version: "0"
|
79
|
-
type: :runtime
|
80
|
-
version_requirements: *id004
|
81
67
|
description: A simple command line tool to help manage Facebook test users and the generation of content.
|
82
68
|
email: georges@ternarylabs.com
|
83
69
|
executables:
|
@@ -88,6 +74,7 @@ extra_rdoc_files: []
|
|
88
74
|
|
89
75
|
files:
|
90
76
|
- bin/geppetto
|
77
|
+
- lib/geppetto/320_240.png
|
91
78
|
- lib/geppetto/cli.rb
|
92
79
|
- lib/geppetto/version.rb
|
93
80
|
- lib/geppetto.rb
|