auto_pilot 0.3.0 → 0.4.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: 66699ea0d34025c2eb70d0d1a3bbea243906e611
4
- data.tar.gz: fc3056a061498cbe0558e4d17efbf881a597542a
3
+ metadata.gz: db723e9aefc72908789f25e7db6034e3c70b96ad
4
+ data.tar.gz: b7fe4e0a74517aab6f295ddfb03e358338fa8626
5
5
  SHA512:
6
- metadata.gz: 81fbb2bc46cbf5396c6fcfcdaba270e8a2bee2ed49e9959f0e59a5cc18d2b47e3d097a379a7173ba5224724dd313d493180a722a1661605a299963f5a051d34e
7
- data.tar.gz: dae28bde6df39119df356b8b412953d652fb329ef49359eab187e636b38625269378105894719c60c855c076842b489c7081f0d4d319f4eb00a2c73bd5064419
6
+ metadata.gz: f8b0eb96fa8bce797067b52971739ca035ec2a8f8dfb3f7ef53927df405eac8efecc3cecbb5525ec66af4c7261892ad271648cabb52c17880b4d5508ddd340df
7
+ data.tar.gz: 8a246c0ace218c8dad0d8afe73837178df0d20376caae7f9ae74747c3a331d2a65db8ebed0e11d768c3f8cbbc612b5101bdf64bd73820d68f869f3264d28381b
data/.gitignore CHANGED
@@ -31,5 +31,5 @@ coverage
31
31
  /blog/
32
32
  /stackoverflow/
33
33
  test/stackoverflow
34
- /auto_pilot_config.rb
35
34
  /.env
35
+ /auto_pilot_config.rb
data/README.md CHANGED
@@ -5,23 +5,28 @@
5
5
  [![Test Coverage](https://codeclimate.com/github/lfender6445/auto_pilot/badges/coverage.svg)](https://codeclimate.com/github/lfender6445/auto_pilot)
6
6
  -->
7
7
 
8
- use this ruby gem to convert your [stackoverflow](http://www.stackoverflow.com/) profile to a [jekyll blog](http://jekyllrb.com/)
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
- in its current form, autopilot will fetch questions you've answered (with a score greater than 0) and convert them to markdown or html
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
- # install + usage
23
+ ## custom templates
24
+ customized templates are as easy as updating your config:
13
25
 
14
- - add `gem 'auto_pilot', '~> 0.2.0'` to gemfile
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
- from there, you can [configure](https://github.com/lfender6445/auto_pilot/blob/master/lib/auto_pilot/templates/auto_pilot_config.rb) auto_pilot's performance
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
- ## todo
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
- - support date of answer in filenames
35
- - get questions after date 2015-03-01
36
- - support embed of original question url
37
- - add documenation for template customization
38
- - add demo repo
44
+ ### demo application
45
+ checkout the [demo application](https://github.com/lfender6445/auto_pilot_demo) and experiment
46
+
47
+ ### screenshots
48
+
49
+ ![side by side](http://i.imgur.com/Ffbzequ.png)
50
+ ________________________
51
+ ![question view](http://i.imgur.com/O206sol.png)
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}\n"
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\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.yellow 'would you like to continue with configuration defaults? y/n'
54
+ log.out 'would you like to modify your configuration? y/n'
55
55
  answer = $stdin.gets.chomp
56
- unless answer == 'y'
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:\n"
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.green 'would you like to add configuration to .gitignore? y/n'
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|
@@ -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 adding an api key to your config you can execute more requests - http://api.stackexchange.com/'
44
+ Log.yellow 'you can execute more requests with an API key - http://api.stackexchange.com/'
45
45
  end
46
46
  end
47
47
 
@@ -1,4 +1,3 @@
1
-
2
1
  AutoPilot.configure do |config|
3
2
  # string or nil - your application key (optional, allows for more requests)
4
3
  config.key = nil
@@ -7,7 +7,7 @@ module AutoPilot
7
7
  attr_accessor :message
8
8
 
9
9
  def out(text)
10
- $stdout.write text
10
+ $stdout.write "#{text}\n"
11
11
  end
12
12
 
13
13
  def colorize(text, color_code)
@@ -1,3 +1,3 @@
1
1
  module AutoPilot
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.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.3.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-16 00:00:00.000000000 Z
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