auto_pilot 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/autopilot +13 -13
- data/lib/auto_pilot/api.rb +1 -1
- data/lib/auto_pilot/templates/auto_pilot_config.rb +2 -2
- data/lib/auto_pilot/util/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 840262a36b0679f5c581e755fb0ed985800de3a7
|
4
|
+
data.tar.gz: d249c81e0cbb866c364c414eb199b3a8b35ab265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d41ef0289f78fd30955d9a201006d67fe63271f2fc5d45420dad63cabc2934307d5c388a5645c463c6c97fd8de20c819accf126363820af39b89ae491ee2240
|
7
|
+
data.tar.gz: 542309f746fe99bd4e1de449441e726c8375602e41b8842073790f4b9c7f1708d84848aa0d1d69daa657448f977a6e292e8dcaee5bec8bfba08206f5a7d03af2
|
data/Gemfile.lock
CHANGED
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?("#{
|
37
|
-
log.out "found existing configuration at #{
|
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
|
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 = "#{
|
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 "#{
|
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 = "#{
|
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
|
-
|
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 = "#{
|
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("#{
|
136
|
+
File.read("#{Dir.pwd}/.gitignore").match(CONF_TEMPLATE)
|
137
137
|
end
|
138
138
|
|
139
139
|
def download_answers_and_write_files
|
data/lib/auto_pilot/api.rb
CHANGED
@@ -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
|
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
|
|
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.
|
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-
|
11
|
+
date: 2015-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|