twog 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Rakefile +0 -20
  2. data/VERSION.yml +3 -3
  3. data/bin/twog +22 -16
  4. data/twog.gemspec +1 -1
  5. metadata +2 -2
data/Rakefile CHANGED
@@ -4,26 +4,6 @@ require 'rake/gempackagetask'
4
4
 
5
5
 
6
6
  namespace :twog do
7
- desc "Generate .twog.yaml file"
8
- task :conf_create do
9
- AUTH_FILE_NAME = "#{ENV['HOME']}/.twog.yaml"
10
-
11
- AUTH_CONFIG_FILE = <<-EOS
12
- rss_feed: 'http://url.com/feed.rss'
13
- consumer_key: 'consumer key'
14
- consumer_secret: 'consumer secret'
15
- access_token: 'access token'
16
- access_secret: 'access secret'
17
- bitly_username: 'username'
18
- bitly_api_key: 'api key'
19
- last_blog_post_tweeted:
20
- EOS
21
-
22
- abort "#{ENV['HOME']}/.twog.yaml already exists" if File.exists?(AUTH_FILE_NAME)
23
-
24
- File.open(AUTH_FILE_NAME, 'w') {|f| f.write(AUTH_CONFIG_FILE) }
25
- end
26
-
27
7
  desc "Clean out the coverage and the pkg"
28
8
  task :clean do
29
9
  rm_rf 'coverage'
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :minor: 2
3
- :patch: 0
4
- :build:
2
+ :patch: 1
5
3
  :major: 0
4
+ :build:
5
+ :minor: 2
data/bin/twog CHANGED
@@ -5,12 +5,19 @@ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
5
5
  require 'twog'
6
6
  require 'optparse'
7
7
 
8
- help = <<HELP
9
- Twog is a tool to tweet blog posts.
8
+ options = {}
9
+ opts = OptionParser.new do |opts|
10
+ opts.banner = "Twog is a tool to tweet blog posts"
10
11
 
11
- Configuration is read from your home directory in the file '.twog.yaml'
12
+ opts.on("--version", "Display current version") do
13
+ puts "Twog " + Twog.version
14
+ exit 0
15
+ end
12
16
 
13
- SAMPLE cong.yaml:
17
+ opts.on("--conf", "Create default conf file") do
18
+ AUTH_FILE_NAME = "#{ENV['HOME']}/.twog.yaml"
19
+
20
+ AUTH_CONFIG_FILE = <<-EOS
14
21
  rss_feed: 'http://url.com/feed.rss'
15
22
  consumer_key: 'consumer key'
16
23
  consumer_secret: 'consumer secret'
@@ -19,15 +26,15 @@ Twog is a tool to tweet blog posts.
19
26
  bitly_username: 'username'
20
27
  bitly_api_key: 'api key'
21
28
  last_blog_post_tweeted:
29
+ EOS
22
30
 
23
- HELP
31
+ if File.exists?(AUTH_FILE_NAME)
32
+ puts "#{ENV['HOME']}/.twog.yaml already exists"
33
+ exit 0
34
+ end
24
35
 
25
- options = {}
26
- opts = OptionParser.new do |opts|
27
- opts.banner = help
28
-
29
- opts.on("--version", "Display current version") do
30
- puts "Jekyll " + Twog.version
36
+ File.open(AUTH_FILE_NAME, 'w') {|f| f.write(AUTH_CONFIG_FILE) }
37
+ puts "Default configuration file created at ~/.twog.yaml"
31
38
  exit 0
32
39
  end
33
40
  end
@@ -36,13 +43,12 @@ end
36
43
  opts.parse!
37
44
 
38
45
  # Get args from the command line
39
- case ARGV.size
40
- when > 0
41
- puts "Invalid options. Run `twog --help` for assistance."
42
- exit(1)
46
+ if ARGV.size > 1
47
+ puts "Invalid options. Run `twog --help` for assistance."
48
+ exit(1)
43
49
  end
44
50
 
45
- raise "please run 'rake twog:conf_create' to create the ~/.twog.yaml file" unless File.exists?("#{ENV['HOME']}/.twog.yaml")
51
+ raise "please run 'twog --conf' to create the ~/.twog.yaml file" unless File.exists?("#{ENV['HOME']}/.twog.yaml")
46
52
  conf = YAML.load_file("#{ENV['HOME']}/.twog.yaml")
47
53
 
48
54
  Twog.run(conf)
data/twog.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{twog}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jason Meridth"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jason Meridth