auto_pilot 0.1.0 → 0.2.0

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: df0efed56cf92bacccd4dc170f0ee6a13cdf5888
4
- data.tar.gz: c52a0e8f003690337ab5c68d5fbbbe21bdab7f1d
3
+ metadata.gz: 840262a36b0679f5c581e755fb0ed985800de3a7
4
+ data.tar.gz: d249c81e0cbb866c364c414eb199b3a8b35ab265
5
5
  SHA512:
6
- metadata.gz: ade5f6da90c08bcb33208111b928389533df86860f3391173ce37b8a37918585a9264181f35fdc47e2e7a2eb5d610fdfeeb971aa5ad47bd3fed893421639bfec
7
- data.tar.gz: 1fb19844424b6fdfdddbc733f4a58cdb1d78c813de0826dc4a3ab3a9b73f5693a49880bc29f77e065ba277857822d110fd9876b43c758443f35ca2604be4a181
6
+ metadata.gz: 2d41ef0289f78fd30955d9a201006d67fe63271f2fc5d45420dad63cabc2934307d5c388a5645c463c6c97fd8de20c819accf126363820af39b89ae491ee2240
7
+ data.tar.gz: 542309f746fe99bd4e1de449441e726c8375602e41b8842073790f4b9c7f1708d84848aa0d1d69daa657448f977a6e292e8dcaee5bec8bfba08206f5a7d03af2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- auto_pilot (0.1.0)
4
+ auto_pilot (0.2.0)
5
5
  httparty (~> 0.11.0)
6
6
  nokogiri (~> 1.6.3.1)
7
7
  reverse_markdown (~> 0.7.0)
data/bin/autopilot CHANGED
@@ -33,8 +33,8 @@ class Application
33
33
  private
34
34
 
35
35
  def ask_user_for_configuration
36
- if File.exist?("#{ROOT}/#{CONF_TEMPLATE}")
37
- log.out "found existing configuration at #{ROOT}/#{CONF_TEMPLATE}\n"
36
+ if File.exist?("#{Dir.pwd}/#{CONF_TEMPLATE}")
37
+ log.out "found existing configuration at #{Dir.pwd}/#{CONF_TEMPLATE}\n"
38
38
  load_configuration
39
39
  else
40
40
  log.out "do you want to create a configuration file? y/n\n"
@@ -54,7 +54,7 @@ class Application
54
54
  log.yellow 'would you like to continue with configuration defaults? y/n'
55
55
  answer = $stdin.gets.chomp
56
56
  unless answer == 'y'
57
- log.out 'when ready, resume by running `autopilot`'
57
+ log.out 'when ready, resume by running: bundle exec autopilot'
58
58
  abort
59
59
  end
60
60
  end
@@ -62,7 +62,7 @@ class Application
62
62
  def update_config_with_user
63
63
  user = ask_for_user
64
64
  update_config_with_answer if user.nil? || user == ''
65
- template = "#{ROOT}/#{CONF_TEMPLATE}"
65
+ template = "#{Dir.pwd}/#{CONF_TEMPLATE}"
66
66
  text = File.read(template)
67
67
  new_contents = text.gsub(/username/, AutoPilot.configuration.user)
68
68
  File.open(template, 'w') { |file| file.puts new_contents }
@@ -74,7 +74,7 @@ class Application
74
74
  end
75
75
 
76
76
  def load_configuration
77
- load "#{ROOT}/#{CONF_TEMPLATE}"
77
+ load "#{Dir.pwd}/#{CONF_TEMPLATE}"
78
78
  end
79
79
  alias_method :reload_config, :load_configuration
80
80
 
@@ -82,16 +82,16 @@ class Application
82
82
  AutoPilot.configure do |config|
83
83
  config.user = ask_for_user
84
84
  config.format = [:md]
85
- config.folder = "#{ROOT}/stackoverflow"
85
+ config.folder = "#{Dir.pwd}/stackoverflow"
86
86
  config.disable_front_matter = false
87
87
  config.max_pages = 1
88
- config.date = { start: '2000-01-00', end: todays_date }
88
+ # config.date = { start: '2000-01-00', end: todays_date }
89
89
  end
90
90
  end
91
91
 
92
- def todays_date
93
- Time.now.to_s.split(' ').first
94
- end
92
+ # def todays_date
93
+ # Time.now.to_s.split(' ').first
94
+ # end
95
95
 
96
96
  def ask_for_user
97
97
  log.out "enter a stackoverflow username:\n"
@@ -117,7 +117,7 @@ class Application
117
117
  end
118
118
 
119
119
  def update_gitignore
120
- gitignore = "#{ROOT}/.gitignore"
120
+ gitignore = "#{Dir.pwd}/.gitignore"
121
121
  if File.exist?(gitignore)
122
122
  unless already_updated_gitignore
123
123
  log.green 'would you like to add configuration to .gitignore? y/n'
@@ -126,14 +126,14 @@ class Application
126
126
  open(gitignore, 'a') do |f|
127
127
  f.puts '/auto_pilot_config.rb'
128
128
  end
129
- log.green 'updated .gitignore'
129
+ log.green '- updated .gitignore'
130
130
  end
131
131
  end
132
132
  end
133
133
  end
134
134
 
135
135
  def already_updated_gitignore
136
- File.read("#{ROOT}/.gitignore").match(CONF_TEMPLATE)
136
+ File.read("#{Dir.pwd}/.gitignore").match(CONF_TEMPLATE)
137
137
  end
138
138
 
139
139
  def download_answers_and_write_files
@@ -41,7 +41,7 @@ module AutoPilot
41
41
  if key = AutoPilot.configuration.key
42
42
  RubyStackoverflow.configure { |config| config.client_key = key }
43
43
  else
44
- Log.yellow 'by signing up for an api key you can execute more requests - http://api.stackexchange.com/'
44
+ Log.yellow 'by adding an api key to your config you can execute more requests - http://api.stackexchange.com/'
45
45
  end
46
46
  end
47
47
 
@@ -1,5 +1,7 @@
1
1
 
2
2
  AutoPilot.configure do |config|
3
+ # string or nil - your application key (optional, allows for more requests)
4
+ config.key = nil
3
5
  # string - a stackoverflow username
4
6
  config.user = 'username'
5
7
  # string - where to put markdown and html files
@@ -11,8 +13,6 @@ AutoPilot.configure do |config|
11
13
  # integer - max pages when crawling paginated answers on your user page
12
14
  # config.max_pages = 50
13
15
  config.max_pages = 2
14
- # string or nil - your application key (optional, allows for more requests)
15
- config.key = nil
16
16
  # integer - time to wait between http requests (optional, eg 3 is 3 seconds)
17
17
  config.throttle = 3
18
18
 
@@ -1,3 +1,3 @@
1
1
  module AutoPilot
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_pilot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Fender
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri