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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3314105065eff21b575c914a34c27f4c159f741f
4
- data.tar.gz: 0fbd347a06f02e3df058772709c22c2915b991fe
3
+ metadata.gz: 12cb30baa85d753ca3113663b320998deb40b0ae
4
+ data.tar.gz: 626d42cd110c64ebeb48975b3f0c46d9dbcd2980
5
5
  SHA512:
6
- metadata.gz: 137196d8d1e69cf1c10c8810452eb9d641b05e47d0843a576c4e5c319f7072e7d53a9863a37bfb197f3043b8dac355cc9c662730ff22bb595e7200483baed4a1
7
- data.tar.gz: b584831e8dced00c6cea23e3a4bf3152c4e85fcac30070c921207cf7c46df72de17d20dfd7edc5add9b4bb79e1fdea4a383c040b723b62e6e274ad77d396aa24
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 yr_bot_name_snake_case_style_yes
14
-
15
- 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.
16
-
17
- You will need to manually set the config variables with yr twitter api keys on heroku for deployment. For development I recommend writing some minitests or just doing it manually on the command line if the bot is simple enough. Testing the bot "live" can run into potential "twitter banning yr bot before
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
@@ -3,7 +3,13 @@
3
3
  require 'twitter_bot_generator'
4
4
 
5
5
  begin
6
- TwitterBotGenerator.generate ARGV[0].gsub('-', '_')
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
@@ -0,0 +1,3 @@
1
+ Hello World!
2
+ Hello Twitter!
3
+ Hello Ruby!
@@ -9,7 +9,7 @@ class <%= class_name %>
9
9
  protected
10
10
 
11
11
  def greetings
12
- ['Hello World!', 'Hello Twitter!', 'Hello Ruby!']
12
+ @greetings ||= load_txt_file 'greetings.txt'
13
13
  end
14
14
 
15
15
  private
@@ -1,4 +1,4 @@
1
1
  class TwitterBotGenerator
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
4
4
 
@@ -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/.gitkeep' => 'lol'
50
+ 'lib/greetings.txt' => (render_code 'lib/greetings.txt', varz)
51
51
  }
52
52
  end
53
53
 
@@ -0,0 +1,6 @@
1
+ # require_relative 'test_helper'
2
+
3
+ # # Running the test suite for the generated bot
4
+ # Dir.chdir('such_test_bot')
5
+ # puts Dir.entries(".").join
6
+ # require_relative '../such_test_bot/test/such_test_bot_test.rb'
@@ -1,16 +1,4 @@
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
- # 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 test_it_creates_bin_slash_gitkeep
83
- assert_equal true, (File.exists? './such_test_bot/lib/.gitkeep')
84
- assert_match /lol/, (File.read './such_test_bot/lib/.gitkeep')
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
@@ -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.2
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