auto_pilot 0.2.0 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 840262a36b0679f5c581e755fb0ed985800de3a7
4
- data.tar.gz: d249c81e0cbb866c364c414eb199b3a8b35ab265
3
+ metadata.gz: 31f0a871e61e3a2789c986aca15b456ab86ee2d2
4
+ data.tar.gz: 190c3264df5b5e4e95972bf3b44d162907e0762b
5
5
  SHA512:
6
- metadata.gz: 2d41ef0289f78fd30955d9a201006d67fe63271f2fc5d45420dad63cabc2934307d5c388a5645c463c6c97fd8de20c819accf126363820af39b89ae491ee2240
7
- data.tar.gz: 542309f746fe99bd4e1de449441e726c8375602e41b8842073790f4b9c7f1708d84848aa0d1d69daa657448f977a6e292e8dcaee5bec8bfba08206f5a7d03af2
6
+ metadata.gz: 5cbf091386da4bf9babf69b2ae3742f0c9d4baf565e7d474ac68ae7cebcfee26b600fd662004ffdf9241d058aef2677a85808da1f0cdd24c1e3a7539b899314e
7
+ data.tar.gz: 48d446d702430bcc55785819fd242fd6a5c37068f8a3fe0988487f0458be4071f98969549d45417e6f76e717b9a95b869acf5d12dd59d9de4e82179962ac4c95
data/Gemfile CHANGED
@@ -13,6 +13,7 @@ group :development do
13
13
  end
14
14
  gem 'rubycritic'
15
15
  gem 'simplecov'
16
+ gem 'rack'
16
17
  end
17
18
 
18
19
  # gem 'codeclimate-test-reporter', group: :test, require: nil
data/README.md CHANGED
@@ -5,47 +5,34 @@
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](https://help.github.com/articles/using-jekyll-with-pages/)
8
+ use this ruby gem to convert your [stackoverflow](http://www.stackoverflow.com/) profile to a [jekyll blog](http://jekyllrb.com/)
9
9
 
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
10
11
 
11
- # usage
12
- supports conversion to html or [markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
12
+ # install + usage
13
13
 
14
- ## Installation
14
+ - add `gem 'auto_pilot', '~> 0.2.0'` to gemfile
15
+ - install via `bundle`
16
+ - run `autopilot` from command line
15
17
 
16
- Add this line to your application's Gemfile:
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
17
19
 
18
- ```ruby
19
- gem 'auto_pilot'
20
- ```
20
+ it is recommended you [sign up for an API key](http://stackapps.com/apps/oauth/register) prior to use
21
21
 
22
- And then execute:
22
+ ## screenshots
23
+ - [side by side](http://i.imgur.com/Ffbzequ.png)
24
+ - [question view](http://i.imgur.com/O206sol.png)
23
25
 
24
- $ bundle
26
+ ## contributing
25
27
 
26
- Or install it yourself as:
27
-
28
- $ gem install auto_pilot
29
-
30
- ## Usage
31
-
32
- TODO: Write usage instructions here
33
-
34
- ## Contributing
35
-
36
- 1. Fork it ( https://github.com/[my-github-username]/auto_pilot/fork )
37
- 2. Create your feature branch (`git checkout -b my-new-feature`)
38
- 3. Commit your changes (`git commit -am 'Add some feature'`)
39
- 4. Push to the branch (`git push origin my-new-feature`)
40
- 5. Create a new Pull Request
28
+ 1. fork it
29
+ 2. create your feature branch
30
+ 3. commit your changes
41
31
 
42
32
  ## todo
43
33
 
44
- create config file and object
45
- support date range restriction
46
- support html conversion
47
- enable switching placemnet of answers and questions
48
-
49
- # api
50
- api.stackexchange.com/2.1
51
-
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
data/bin/autopilot CHANGED
@@ -137,7 +137,6 @@ class Application
137
137
  end
138
138
 
139
139
  def download_answers_and_write_files
140
- # AutoPilot.write_files(AutoPilot.get_answers)
141
140
  AutoPilot.write_files(AutoPilot.get_api_answers)
142
141
  end
143
142
 
@@ -62,7 +62,7 @@ module AutoPilot
62
62
 
63
63
  def filtered(answers)
64
64
  if answers.length > 0
65
- filtered_answers = answers.flatten.uniq.select { |answer| answer.score > 0 }
65
+ filtered_answers = answers.flatten.uniq.select { |answer| answer.score > (AutoPilot.configuration.score_threshold || 0) }
66
66
  [].tap do |arr|
67
67
  filtered_answers.each do |answer|
68
68
  arr << { answer_id: answer.answer_id, question_id: answer.question_id }
@@ -4,19 +4,16 @@ AutoPilot.configure do |config|
4
4
  config.key = nil
5
5
  # string - a stackoverflow username
6
6
  config.user = 'username'
7
- # string - where to put markdown and html files
7
+ # integer - score must be greater than threshold in order to qualify for download
8
+ config.score_threshold = -1
9
+ # string - where to put markdown or html files
8
10
  config.folder = 'stackoverflow'
9
11
  # array - convert to [:md], [:html], or both eg [:md, :html]
10
12
  config.format = [:md]
11
13
  # boolean - prevent frontmatter from being added to markdown files
12
14
  config.disable_front_matter = false
13
15
  # integer - max pages when crawling paginated answers on your user page
14
- # config.max_pages = 50
15
16
  config.max_pages = 2
16
17
  # integer - time to wait between http requests (optional, eg 3 is 3 seconds)
17
18
  config.throttle = 3
18
-
19
- # TODO: support date confiugrations
20
- # hash - retrieve questions and answers within a date range eg { start: '2000-01-00', end: '2015-03-05' }
21
- # config.date = { start: '2000-01-00', end: Time.now.to_s.split(' ').first }
22
19
  end
@@ -1,3 +1,3 @@
1
1
  module AutoPilot
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.2'
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.2.0
4
+ version: 0.2.2
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-14 00:00:00.000000000 Z
11
+ date: 2015-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri