auto_pilot 0.3.0 → 0.4.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/.gitignore +1 -1
- data/README.md +39 -19
- data/auto_pilot.gemspec +1 -0
- data/bin/autopilot +6 -11
- data/lib/auto_pilot/api.rb +1 -1
- data/lib/auto_pilot/templates/auto_pilot_config.rb +0 -1
- data/lib/auto_pilot/util/log.rb +1 -1
- data/lib/auto_pilot/util/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db723e9aefc72908789f25e7db6034e3c70b96ad
|
4
|
+
data.tar.gz: b7fe4e0a74517aab6f295ddfb03e358338fa8626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8b0eb96fa8bce797067b52971739ca035ec2a8f8dfb3f7ef53927df405eac8efecc3cecbb5525ec66af4c7261892ad271648cabb52c17880b4d5508ddd340df
|
7
|
+
data.tar.gz: 8a246c0ace218c8dad0d8afe73837178df0d20376caae7f9ae74747c3a331d2a65db8ebed0e11d768c3f8cbbc612b5101bdf64bd73820d68f869f3264d28381b
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -5,23 +5,28 @@
|
|
5
5
|
[](https://codeclimate.com/github/lfender6445/auto_pilot)
|
6
6
|
-->
|
7
7
|
|
8
|
-
|
8
|
+
a step forward in blog automation
|
9
|
+
- use this ruby gem to convert your [stackoverflow](http://www.stackoverflow.com/) profile to a [jekyll blog](http://jekyllrb.com/) and [more](#do-i-have-to-use-jekyll)
|
10
|
+
- fetch questions for a specifc user and convert them to markdown or html
|
9
11
|
|
10
|
-
|
12
|
+
## how do i
|
13
|
+
- __install autpilot?__
|
14
|
+
- add `gem 'auto_pilot', '~> 0.4.0'` to gemfile as development dependency
|
15
|
+
- run `bundle install`
|
16
|
+
- __use autopilot?__
|
17
|
+
- run `bundle exec autopilot` from command line
|
18
|
+
- the bin will create a [config file](https://github.com/lfender6445/auto_pilot/blob/master/lib/auto_pilot/templates/auto_pilot_config.rb) in the root of your project
|
19
|
+
- [customize templates?](#custom-templates)
|
20
|
+
- [register for an API key?](http://stackapps.com/apps/oauth/register)
|
21
|
+
- [see demo?](#demo-application)
|
11
22
|
|
12
|
-
|
23
|
+
## custom templates
|
24
|
+
customized templates are as easy as updating your config:
|
13
25
|
|
14
|
-
|
15
|
-
- install via `bundle`
|
16
|
-
- run `autopilot` from command line
|
26
|
+
[full example of config with custom template](https://github.com/lfender6445/auto_pilot_demo/blob/custom_templates/auto_pilot_config.rb#L21)
|
17
27
|
|
18
|
-
|
19
|
-
|
20
|
-
it is recommended you [sign up for an API key](http://stackapps.com/apps/oauth/register) prior to use
|
21
|
-
|
22
|
-
## screenshots
|
23
|
-
- [side by side](http://i.imgur.com/Ffbzequ.png)
|
24
|
-
- [question view](http://i.imgur.com/O206sol.png)
|
28
|
+
- we can update our config with an override of [MarkdownConverter#md_template](https://github.com/lfender6445/auto_pilot/blob/e6fd551d64d27cd2a813bb71e6c0997eee9196d2/lib/auto_pilot/markdown_converter.rb#L25)
|
29
|
+
- for html, override [HTMLConverter#html_template](https://github.com/lfender6445/auto_pilot/blob/e6fd551d64d27cd2a813bb71e6c0997eee9196d2/lib/auto_pilot/html_converter.rb#L27)
|
25
30
|
|
26
31
|
## contributing
|
27
32
|
|
@@ -29,10 +34,25 @@ it is recommended you [sign up for an API key](http://stackapps.com/apps/oauth/r
|
|
29
34
|
2. create your feature branch
|
30
35
|
3. commit your changes
|
31
36
|
|
32
|
-
|
37
|
+
________________________
|
38
|
+
|
39
|
+
### do i have to use jekyll
|
40
|
+
__no__. we are just generating partials from stackoverflow posts - they could be integrated with wordpress or rails projects with ease
|
41
|
+
|
42
|
+
you will also want to set `disable_front_matter = true` in your config when using outside of jekyll
|
33
43
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
44
|
+
### demo application
|
45
|
+
checkout the [demo application](https://github.com/lfender6445/auto_pilot_demo) and experiment
|
46
|
+
|
47
|
+
### screenshots
|
48
|
+
|
49
|
+

|
50
|
+
________________________
|
51
|
+

|
52
|
+
|
53
|
+
## todo
|
54
|
+
- change file naming convention to date question answered
|
55
|
+
- update config options
|
56
|
+
- get questions after date x
|
57
|
+
- credit sources
|
58
|
+
- support erb templates
|
data/auto_pilot.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
|
+
spec.post_install_message = 'added bin autopilot'
|
20
21
|
|
21
22
|
spec.add_dependency 'nokogiri', '~> 1.6.3.1'
|
22
23
|
spec.add_dependency 'httparty', '~> 0.11.0'
|
data/bin/autopilot
CHANGED
@@ -34,10 +34,10 @@ class Application
|
|
34
34
|
|
35
35
|
def ask_user_for_configuration
|
36
36
|
if File.exist?("#{Dir.pwd}/#{CONF_TEMPLATE}")
|
37
|
-
log.out "found existing configuration at #{Dir.pwd}/#{CONF_TEMPLATE}
|
37
|
+
log.out "found existing configuration at #{Dir.pwd}/#{CONF_TEMPLATE}"
|
38
38
|
load_configuration
|
39
39
|
else
|
40
|
-
log.out "do you want to create a configuration file? y/n
|
40
|
+
log.out "do you want to create a configuration file? y/n"
|
41
41
|
answer = $stdin.gets.chomp
|
42
42
|
if answer == 'y'
|
43
43
|
add_configuration_file
|
@@ -51,10 +51,9 @@ class Application
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def ask_user_to_keep_going
|
54
|
-
log.
|
54
|
+
log.out 'would you like to modify your configuration? y/n'
|
55
55
|
answer = $stdin.gets.chomp
|
56
|
-
|
57
|
-
log.out 'when ready, resume by running: bundle exec autopilot'
|
56
|
+
if answer == 'y'
|
58
57
|
abort
|
59
58
|
end
|
60
59
|
end
|
@@ -67,10 +66,6 @@ class Application
|
|
67
66
|
new_contents = text.gsub(/username/, AutoPilot.configuration.user)
|
68
67
|
File.open(template, 'w') { |file| file.puts new_contents }
|
69
68
|
reload_config
|
70
|
-
validate_config
|
71
|
-
end
|
72
|
-
|
73
|
-
def validate_config
|
74
69
|
end
|
75
70
|
|
76
71
|
def load_configuration
|
@@ -94,7 +89,7 @@ class Application
|
|
94
89
|
# end
|
95
90
|
|
96
91
|
def ask_for_user
|
97
|
-
log.out "enter a stackoverflow username
|
92
|
+
log.out "enter a stackoverflow username:"
|
98
93
|
answer = $stdin.gets.chomp
|
99
94
|
if answer.nil? or answer == ''
|
100
95
|
log.red '- invalid username, try again'
|
@@ -120,7 +115,7 @@ class Application
|
|
120
115
|
gitignore = "#{Dir.pwd}/.gitignore"
|
121
116
|
if File.exist?(gitignore)
|
122
117
|
unless already_updated_gitignore
|
123
|
-
log.
|
118
|
+
log.out 'would you like to add configuration to .gitignore? (recommended) y/n'
|
124
119
|
answer = $stdin.gets.chomp
|
125
120
|
if answer == 'y'
|
126
121
|
open(gitignore, 'a') do |f|
|
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 '
|
44
|
+
Log.yellow 'you can execute more requests with an API key - http://api.stackexchange.com/'
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
data/lib/auto_pilot/util/log.rb
CHANGED
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.4.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-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -164,7 +164,7 @@ homepage: ''
|
|
164
164
|
licenses:
|
165
165
|
- MIT
|
166
166
|
metadata: {}
|
167
|
-
post_install_message:
|
167
|
+
post_install_message: added bin autopilot
|
168
168
|
rdoc_options: []
|
169
169
|
require_paths:
|
170
170
|
- lib
|