twitter_bot_generator 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -11
- data/bin/twitter_bot_generator +7 -1
- data/lib/twitter_bot_generator/templates/lib/greetings.txt.erb +3 -0
- data/lib/twitter_bot_generator/templates/src/test_bot.rb.erb +1 -1
- data/lib/twitter_bot_generator/version.rb +1 -1
- data/lib/twitter_bot_generator.rb +1 -1
- data/test/generated_bot_test.rb +6 -0
- data/test/scaffold_generator_test.rb +4 -33
- data/test/test_helper.rb +28 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12cb30baa85d753ca3113663b320998deb40b0ae
|
4
|
+
data.tar.gz: 626d42cd110c64ebeb48975b3f0c46d9dbcd2980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a076b4c7b343590500e387969abdf1edf5ad98afa29d01ed5648334537842f48401f3ec7ff486ade420b5bc763d146ad7c427a02c079d8af99fb9cf11ad4e777
|
7
|
+
data.tar.gz: 649f4541cb506ba602190045dd84b76cd284f42d656f2c98479c0dd6ea458be39ffaf2405ac7c5c43955a4941aad3ba12e0635c8df0db79272f41d251b200a01
|
data/README.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# twitter_bot_generator
|
2
2
|
|
3
|
-
[watch this terrible hour long clicky screencast to see it in action!](https://vimeo.com/105286654)
|
4
|
-
|
5
3
|
#### I GENERATE TWITTER BOTS! RUBY IS JOY!
|
6
4
|
|
7
5
|
## Installation
|
@@ -10,11 +8,35 @@
|
|
10
8
|
|
11
9
|
## Usage
|
12
10
|
|
13
|
-
$ twitter_bot_generator
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
$ twitter_bot_generator --help
|
12
|
+
twitter_bot_generator <yr_bots_name_camel_cased>
|
13
|
+
## creates a new directory called <yr_bots_name_camel_cased> in the current working directory,
|
14
|
+
and fills it with a bunch of boilerplate goodness
|
15
|
+
|
16
|
+
$ twitter_bot_generator wat_fun
|
17
|
+
scaffolding a twitter bot that is named wat_fun!
|
18
|
+
mkdir wat_fun/
|
19
|
+
mkdir wat_fun/lib
|
20
|
+
mkdir wat_fun/src
|
21
|
+
mkdir wat_fun/test
|
22
|
+
touch wat_fun/bot.rb
|
23
|
+
touch wat_fun/.gitignore
|
24
|
+
touch wat_fun/Gemfile
|
25
|
+
touch wat_fun/README.md
|
26
|
+
touch wat_fun/Procfile
|
27
|
+
touch wat_fun/spec.rb
|
28
|
+
touch wat_fun/test.rb
|
29
|
+
touch wat_fun/test/wat_fun_test.rb
|
30
|
+
touch wat_fun/src/wat_fun.rb
|
31
|
+
touch wat_fun/lib/greetings.txt
|
32
|
+
done generating! your turn now!
|
33
|
+
$ cd wat_fun
|
34
|
+
$ bundle install
|
35
|
+
$ ./test.rb
|
36
|
+
$ ./spec.rb
|
37
|
+
HAVE FUN BE SAFE PLAY NICE
|
38
|
+
|
39
|
+
This will create a skeleton class named YrBotNameSnakeCaseStyleYes, some smokescreen minitest::unit tests, and a variety of other "ruby app on free heroku instance" boiler plate. You will need to manually set the config variables with yr twitter api keys on heroku for deployment or add figaro or some such... documentation/scripts forthcoming
|
18
40
|
|
19
41
|
This gem was made for use in the twitter-art-robot-[tutorial](http://github.com/coleww/twitter-art-tutorial) and more details and documentation and such will be there when things happen. :dancers:
|
20
42
|
|
@@ -22,7 +44,3 @@ This gem was made for use in the twitter-art-robot-[tutorial](http://github.com/
|
|
22
44
|
|
23
45
|
all kinds of issues in the thing to the upper right! =>
|
24
46
|
comment on something if it sounds cool to u
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
http://stackoverflow.com/questions/1338960/ruby-templates-how-to-pass-variables-into-inlined-erb
|
data/bin/twitter_bot_generator
CHANGED
@@ -3,7 +3,13 @@
|
|
3
3
|
require 'twitter_bot_generator'
|
4
4
|
|
5
5
|
begin
|
6
|
-
|
6
|
+
if !ARGV[0] || ARGV[0] == '--help'
|
7
|
+
puts 'twitter_bot_generator <yr_bots_name_camel_cased>'
|
8
|
+
puts '## creates a new directory called <yr_bots_name_camel_cased> in the current working directory, '
|
9
|
+
puts 'and fills it with a bunch of boilerplate goodness'
|
10
|
+
else
|
11
|
+
TwitterBotGenerator.generate ARGV[0].gsub('-', '_')
|
12
|
+
end
|
7
13
|
rescue
|
8
14
|
puts 'something horrible has happened'
|
9
15
|
end
|
@@ -47,7 +47,7 @@ class TwitterBotGenerator
|
|
47
47
|
'test.rb' => (render_code 'test.rb', varz),
|
48
48
|
"test/#{bot_name}_test.rb" => (render_code 'test/test_bot_test.rb', varz),
|
49
49
|
"src/#{bot_name}.rb" => (render_code 'src/test_bot.rb', varz),
|
50
|
-
'lib
|
50
|
+
'lib/greetings.txt' => (render_code 'lib/greetings.txt', varz)
|
51
51
|
}
|
52
52
|
end
|
53
53
|
|
@@ -1,16 +1,4 @@
|
|
1
|
-
|
2
|
-
require 'minitest/autorun'
|
3
|
-
require 'minitest/pride'
|
4
|
-
require 'coveralls'
|
5
|
-
Coveralls.wear!
|
6
|
-
|
7
|
-
require_relative "../lib/twitter_bot_generator.rb"
|
8
|
-
|
9
|
-
# before :all do
|
10
|
-
TwitterBotGenerator.generate 'such_test_bot'
|
11
|
-
|
12
|
-
# Running the test suite for the generated bot
|
13
|
-
require_relative '../such_test_bot/test/such_test_bot_test.rb'
|
1
|
+
require_relative 'test_helper'
|
14
2
|
|
15
3
|
class TestTwitterBotGenerator < MiniTest::Test
|
16
4
|
|
@@ -79,9 +67,9 @@ class TestTwitterBotGenerator < MiniTest::Test
|
|
79
67
|
assert_match /def generate/, (File.read './such_test_bot/src/such_test_bot.rb')
|
80
68
|
end
|
81
69
|
|
82
|
-
def
|
83
|
-
assert_equal true, (File.exists? './such_test_bot/lib
|
84
|
-
assert_match /
|
70
|
+
def test_it_creates_lib_slash_greetings
|
71
|
+
assert_equal true, (File.exists? './such_test_bot/lib/greetings.txt')
|
72
|
+
assert_match /Hello World!/, (File.read './such_test_bot/lib/greetings.txt')
|
85
73
|
end
|
86
74
|
|
87
75
|
def test_camelize
|
@@ -91,20 +79,3 @@ class TestTwitterBotGenerator < MiniTest::Test
|
|
91
79
|
|
92
80
|
end
|
93
81
|
|
94
|
-
MiniTest::Unit.after_tests do
|
95
|
-
['./such_test_bot/Gemfile',
|
96
|
-
'./such_test_bot/README.md',
|
97
|
-
'./such_test_bot/test.rb',
|
98
|
-
'./such_test_bot/Procfile',
|
99
|
-
'./such_test_bot/bot.rb',
|
100
|
-
'./such_test_bot/spec.rb',
|
101
|
-
'./such_test_bot/test/such_test_bot_test.rb',
|
102
|
-
'./such_test_bot/lib/.gitkeep',
|
103
|
-
'./such_test_bot/src/such_test_bot.rb',
|
104
|
-
'./such_test_bot/.gitignore'].each { |file| File.unlink file }
|
105
|
-
|
106
|
-
['./such_test_bot/lib',
|
107
|
-
'./such_test_bot/src',
|
108
|
-
'./such_test_bot/test',
|
109
|
-
'./such_test_bot'].each { |dir| Dir.rmdir dir }
|
110
|
-
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'minitest/pride'
|
4
|
+
require 'coveralls'
|
5
|
+
Coveralls.wear!
|
6
|
+
|
7
|
+
require_relative "../lib/twitter_bot_generator.rb"
|
8
|
+
|
9
|
+
# before :all do
|
10
|
+
TwitterBotGenerator.generate 'such_test_bot'
|
11
|
+
|
12
|
+
Minitest.after_run do
|
13
|
+
['./such_test_bot/Gemfile',
|
14
|
+
'./such_test_bot/README.md',
|
15
|
+
'./such_test_bot/test.rb',
|
16
|
+
'./such_test_bot/Procfile',
|
17
|
+
'./such_test_bot/bot.rb',
|
18
|
+
'./such_test_bot/spec.rb',
|
19
|
+
'./such_test_bot/test/such_test_bot_test.rb',
|
20
|
+
'./such_test_bot/lib/greetings.txt',
|
21
|
+
'./such_test_bot/src/such_test_bot.rb',
|
22
|
+
'./such_test_bot/.gitignore'].each { |file| File.unlink file }
|
23
|
+
|
24
|
+
['./such_test_bot/lib',
|
25
|
+
'./such_test_bot/src',
|
26
|
+
'./such_test_bot/test',
|
27
|
+
'./such_test_bot'].each { |dir| Dir.rmdir dir }
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter_bot_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cole Willsea
|
@@ -108,7 +108,9 @@ files:
|
|
108
108
|
- lib/twitter_bot_generator/templates/test.rb.erb
|
109
109
|
- lib/twitter_bot_generator/templates/test/test_bot_test.rb.erb
|
110
110
|
- lib/twitter_bot_generator/version.rb
|
111
|
+
- test/generated_bot_test.rb
|
111
112
|
- test/scaffold_generator_test.rb
|
113
|
+
- test/test_helper.rb
|
112
114
|
- twitter_bot_generator.gemspec
|
113
115
|
homepage: https://github.com/coleww/twitter_bot_generator
|
114
116
|
licenses:
|
@@ -135,4 +137,6 @@ signing_key:
|
|
135
137
|
specification_version: 4
|
136
138
|
summary: Generates a twitter bot template from command line.
|
137
139
|
test_files:
|
140
|
+
- test/generated_bot_test.rb
|
138
141
|
- test/scaffold_generator_test.rb
|
142
|
+
- test/test_helper.rb
|