shit-avi-says 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/shitavisays +9 -0
  2. data/lib/shit_avi_says.rb +72 -0
  3. metadata +64 -0
data/bin/shitavisays ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
4
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
5
+
6
+ load 'shit_avi_says.rb'
7
+
8
+ shit_avi_says = ShitAviSays.new(ARGV)
9
+
@@ -0,0 +1,72 @@
1
+ require 'tumblr'
2
+
3
+ class ShitAviSays
4
+ #Any command Line options set are passed in as array argv
5
+ # You cannot have arguments as CONSTANTS plus if it was
6
+ # ARGV it would clash with the built in ARGV.
7
+ # def authorize(argv[""])
8
+
9
+
10
+ # end
11
+ def authorize
12
+ puts "What's the almighty consumer key?"
13
+ ARGV.clear
14
+ consumer_key = gets.chomp
15
+
16
+ puts "What's the almighty secret key?"
17
+ consumer_secret = gets.chomp
18
+
19
+ # path = File.expand_path("~")
20
+
21
+ # File.open("#{path}/.tumblr", 'w') do |file|
22
+ # file.write("---
23
+ # consumer_key: #{consumer_key}
24
+ # consumer_secret: #{consumer_secret}
25
+ # token: IJQjtsdHUjv0yYdKDdEE9Kio82VJ8IsDZYtyAEgtI1aHHW3AZb
26
+ # token_secret: xh6nyeHz7LJc6GLg3OEUm2wrg4EXlvVBzRKaZ5OO2QjdjLjGuP")
27
+ # end
28
+
29
+ File.open("cache", 'w') do |file|
30
+ file.write("configured")
31
+ end
32
+ end
33
+
34
+ def initialize(argv)
35
+ if argv[0] == "config"
36
+
37
+ authorize
38
+
39
+ else
40
+ File.open("cache") do |file|
41
+ while line = file.gets
42
+ if line == "configured"
43
+ puts "What shit did Avi say??"
44
+
45
+
46
+ command = gets.chomp
47
+
48
+ if command
49
+ exec("tumblr post '#{command}' --host=http://shitavisays.tumblr.com/")
50
+ end
51
+ else
52
+ puts "please configure the keys - use shitavisays config on a fresh prompt"
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+
59
+
60
+
61
+
62
+
63
+ # puts "What shit did Avi say??"
64
+
65
+ # post_array = []
66
+ # command = gets.chomp
67
+
68
+ # if command
69
+ # exec("tumblr post '#{command}' --host=http://shitavisays.tumblr.com/")
70
+ # end
71
+
72
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shit-avi-says
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ice Breakers
9
+ autorequire:
10
+ bindir: ./bin
11
+ cert_chain: []
12
+ date: 2013-06-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: tumblr-rb
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 2.1.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.1.1
30
+ description: Shit Avi Says!
31
+ email: adam.waxman@flatironschool.com
32
+ executables:
33
+ - shitavisays
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - bin/shitavisays
38
+ - lib/shit_avi_says.rb
39
+ - ./bin/shitavisays
40
+ homepage: https://github.com/awaxman11/shitavisays-gem
41
+ licenses: []
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubyforge_project: shit-avi-says
60
+ rubygems_version: 1.8.25
61
+ signing_key:
62
+ specification_version: 3
63
+ summary: Post shit avi says on Tumblr through the command line
64
+ test_files: []