octodown 0.1.0beta1 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3011aaac61ee304bc3439716128d596750f8492
4
- data.tar.gz: f391bb139714707d690efd512f2145d3565cf339
3
+ metadata.gz: 1ae27659b96dc1aed9d8e54fc5fae1eb5af80ecb
4
+ data.tar.gz: a312690de332fd10839cc6d554c1caeb60043ed9
5
5
  SHA512:
6
- metadata.gz: 438fc034632fc7760d0bd91bc9448f34a9ca551ddf3fef6d13f44f798ea90a1c74d874a24b75eeb7a5fd837c25a432adcf078cb48f46deedda403d68945552bf
7
- data.tar.gz: 114b94fffa16b686ef1fd6c2dee9f652cb40cf4d9dd60a9579d326ec1654bf17b68aaecae7c7192b13b8b64f5518d2a1151eebe5fe73e09433be2e6453316111
6
+ metadata.gz: 01102c2586155236c32827b65e9ec201ed96b32e90beb10ceb594a08a6a3318e2ff4cdce647f07cb3cecf61d36f5a8ab18b6762e5fd7e5df3030b9cfcc4dc85d
7
+ data.tar.gz: a27239bef742f5a5f4d42b63c0558f478428fe2e6992e671945cb5f181584db336c057e82970bd2a9d4961ad4dfb2304871ba5fbb61e3ced8a0bbb6f6e2695e4
checksums.yaml.gz.sig CHANGED
Binary file
data/.rubocop.yml ADDED
@@ -0,0 +1,15 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'octodown.gemspec'
4
+ - 'Rakefile'
5
+
6
+ Style/Documentation:
7
+ Description: 'Document classes and non-namespace modules.'
8
+ Enabled: false
9
+
10
+ Style/HashSyntax:
11
+ Description: >-
12
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
13
+ { :a => 1, :b => 2 }.
14
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
15
+ Enabled: false
data/.travis.yml CHANGED
@@ -4,8 +4,11 @@ before_install:
4
4
  - gem update --system
5
5
  - sudo apt-get install -y libicu-dev build-essential
6
6
  install: 'bundle install'
7
- script: 'bundle exec rspec --format documentation'
7
+ script:
8
+ - 'bundle exec rspec --format documentation'
9
+ - 'bundle exec rubocop'
8
10
  rvm:
11
+ - '2.2.0'
9
12
  - '2.1.4'
10
13
  - '2.0.0'
11
14
  - '1.9.3'
data/README.md CHANGED
@@ -21,8 +21,8 @@ you. Dead simple. Never get caught writing ugly markdown again.
21
21
 
22
22
  ## Installation
23
23
 
24
- 1. Install `icu4u` and `cmake`:
25
- * Mac: `$ brew install icu4u cmake`
24
+ 1. Install `icu4c` and `cmake`:
25
+ * Mac: `$ brew install icu4c cmake`
26
26
  * Apt: `$ sudo apt-get install -y libicu-dev cmake`
27
27
  2. If you have a non-system Ruby (*highly recommended*):
28
28
  * `$ gem install octodown`
@@ -32,11 +32,11 @@ you. Dead simple. Never get caught writing ugly markdown again.
32
32
  ## Usage
33
33
 
34
34
  1. Basic:
35
- $ octodown README.md
35
+ * `$ octodown README.md`
36
36
  2. Markdown preview styling
37
- $ octodown --style atom README.md
37
+ * `$ octodown --style atom README.md`
38
38
  3. *nix lovers
39
- $ echo '# Hello world!' | octodown --raw > index.html
39
+ * `$ echo '# Hello world!' | octodown --raw > index.html`
40
40
 
41
41
  ## Notes
42
42
 
data/bin/octodown CHANGED
@@ -10,7 +10,12 @@ options = {}
10
10
  OptionParser.new do |opts|
11
11
  opts.banner = 'Usage: octodown [options]'
12
12
 
13
- opts.on('-s', '--style [STYLE]', [:github, :atom], 'Choose style (atom, github)') do |s|
13
+ opts.on(
14
+ '-s',
15
+ '--style [STYLE]',
16
+ [:github, :atom],
17
+ 'Choose style (atom, github)'
18
+ ) do |s|
14
19
  options[:style] = s
15
20
  end
16
21
 
@@ -18,7 +18,7 @@ module Octodown
18
18
  private
19
19
 
20
20
  def context
21
- { :asset_root => 'https://assets-cdn.github.com/images/icons/'}
21
+ { :asset_root => 'https://assets-cdn.github.com/images/icons/' }
22
22
  end
23
23
 
24
24
  def pipeline
@@ -21,8 +21,12 @@ module Octodown
21
21
  end
22
22
 
23
23
  def stylesheet
24
- stylesheet_file = File.join Octodown.root, 'assets',
24
+ stylesheet_file = File.join(
25
+ Octodown.root,
26
+ 'assets',
25
27
  "#{template}.css"
28
+ )
29
+
26
30
  File.read stylesheet_file
27
31
  end
28
32
 
@@ -15,7 +15,7 @@ module Octodown
15
15
  attr_reader :cmd
16
16
 
17
17
  def determine_browser_open_cmd
18
- open_in_browser_candidates.detect { |cmd| File.exists? cmd }
18
+ open_in_browser_candidates.detect { |cmd| File.exist? cmd }
19
19
  end
20
20
 
21
21
  def open_in_browser_candidates
@@ -10,9 +10,9 @@ module Octodown
10
10
  end
11
11
 
12
12
  def persistent_write(content)
13
- self.write content
14
- self.close
15
- self.persist
13
+ write content
14
+ close
15
+ persist
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module Octodown
2
- VERSION = '0.1.0beta1'
2
+ VERSION = '1.0.0'
3
3
  end
data/octodown.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Octodown::VERSION
9
9
  spec.authors = ['Ian Ker-Seymer']
10
10
  spec.email = ['i.kerseymer@gmail.com']
11
- spec.summary = %q{Simple and precise markdown previewing from your terminal.}
11
+ spec.summary = 'Github markdown straight from your shell.'
12
12
  spec.homepage = 'https://github.com/ianks/octodown'
13
13
  spec.license = 'MIT'
14
14
 
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'pygments.rb', '~> 0.6.0'
27
27
 
28
28
  spec.add_development_dependency 'rspec', '~> 3.1.0'
29
+ spec.add_development_dependency 'rubocop', '~> 0.28.0'
29
30
  spec.add_development_dependency 'bundler', '~> 1.7'
30
31
  spec.add_development_dependency 'rake', '~> 10.0'
31
32
  end
@@ -2,11 +2,15 @@ require 'tempfile'
2
2
 
3
3
  describe Octodown::Renderer::GithubMarkdown do
4
4
  let(:dummy_path) { File.join(File.dirname(__FILE__), 'dummy', 'test.md') }
5
- let(:html) { Octodown::Renderer::GithubMarkdown.new(File.read(dummy_path)).to_html }
5
+ let(:html) do
6
+ Octodown::Renderer::GithubMarkdown.new(File.read(dummy_path)).to_html
7
+ end
6
8
 
7
9
  it 'create HTML from markdown file' do
8
10
  expect(html).to include '<h1>Hello world!</h1>'
9
- expect(html).to include '<p>You are now reading markdown. How lucky you are!</p>'
11
+ expect(html).to include(
12
+ '<p>You are now reading markdown. How lucky you are!</p>'
13
+ )
10
14
  end
11
15
 
12
16
  it 'highlights the code' do
@@ -2,15 +2,20 @@ require 'tempfile'
2
2
 
3
3
  describe Octodown::Renderer::HTML do
4
4
  let(:dummy_path) { File.join(File.dirname(__FILE__), 'dummy', 'test.md') }
5
- let(:html) { Octodown::Renderer::GithubMarkdown.new(File.read(dummy_path)).to_html }
5
+ let(:html) do
6
+ Octodown::Renderer::GithubMarkdown.new(File.read(dummy_path)).to_html
7
+ end
8
+
6
9
  subject { Octodown::Renderer::HTML.new(html, 'github').render }
7
10
 
8
11
  before { allow(Octodown).to receive(:root) { '.' } }
9
12
 
10
13
  it 'includes HTML from markdown rendering phase' do
11
14
  expect(subject).to include '<h1>Hello world!</h1>'
12
- expect(subject).to include '<p>You are now reading markdown. How lucky you are!</p>'
13
15
  expect(subject).to include 'highlight-ruby'
16
+ expect(subject).to include(
17
+ '<p>You are now reading markdown. How lucky you are!</p>'
18
+ )
14
19
  end
15
20
 
16
21
  it 'sets the title' do
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octodown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0beta1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
@@ -30,7 +30,7 @@ cert_chain:
30
30
  YGBeYMyEy7Q4wf7k4k5yyDUZyyaeg0DF/kNEN5llspJ9DHMP2cQqOiH+IQSNiUhR
31
31
  32sJqaZRHeJLDhZPLi5yXItTsQnPy6uob2oyypwFYTM=
32
32
  -----END CERTIFICATE-----
33
- date: 2014-12-25 00:00:00.000000000 Z
33
+ date: 2015-01-02 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: github-markup
@@ -144,6 +144,20 @@ dependencies:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
146
  version: 3.1.0
147
+ - !ruby/object:Gem::Dependency
148
+ name: rubocop
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: 0.28.0
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: 0.28.0
147
161
  - !ruby/object:Gem::Dependency
148
162
  name: bundler
149
163
  requirement: !ruby/object:Gem::Requirement
@@ -182,6 +196,7 @@ extra_rdoc_files: []
182
196
  files:
183
197
  - ".gitignore"
184
198
  - ".rspec"
199
+ - ".rubocop.yml"
185
200
  - ".travis.yml"
186
201
  - Gemfile
187
202
  - LICENSE.txt
@@ -220,15 +235,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
220
235
  version: '0'
221
236
  required_rubygems_version: !ruby/object:Gem::Requirement
222
237
  requirements:
223
- - - ">"
238
+ - - ">="
224
239
  - !ruby/object:Gem::Version
225
- version: 1.3.1
240
+ version: '0'
226
241
  requirements: []
227
242
  rubyforge_project:
228
243
  rubygems_version: 2.4.5
229
244
  signing_key:
230
245
  specification_version: 4
231
- summary: Simple and precise markdown previewing from your terminal.
246
+ summary: Github markdown straight from your shell.
232
247
  test_files:
233
248
  - spec/browser_spec.rb
234
249
  - spec/dummy/test.md
metadata.gz.sig CHANGED
Binary file