jekyll-gist 1.1.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 956dde53efdc7ba004b745ad63965672a082de7b
4
- data.tar.gz: 1bb48861f6d8676f0450b3508390f28da05b0040
3
+ metadata.gz: ed09a3cafb596362202df4f48741906cbddec749
4
+ data.tar.gz: 0a90da5fabf39ea40b4b17e24a6e8bc93d519d0e
5
5
  SHA512:
6
- metadata.gz: 579e357cb1bc2996bb2d4c2a6fb4daf5f1c9a33e794ab7eef245a7c20197cd88cac90dc81cfae6fdc33b1d15de1101801e6341ceb3c97e4f0d9a2105f27d3c6a
7
- data.tar.gz: 3e286821b3a9820c1049908d1cae54e9b7df2d6892499f8fadc475a36b401f7acc7269e3510b22f5dad4c77ac2544f901bf48d6b46951395c4660b4960cc2a6d
6
+ metadata.gz: 095086033d1f0df077e8ce8b8b0bdc88bcaa3752a24319015fb1103f48836b5835b7370c2cd341647091d050afaec9fc80686bc92e97ba5b1c423ea4e9a29090
7
+ data.tar.gz: 7cb7bc609c2c35d52b1060b7a0ace74889fad705916000719fbc076befdbdb0608bac15b295faedfb6b9cf9020b4bf8c35a67ffa338e1c1fe9c130815fb0c1af
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ script : script/cibuild
3
+ rvm:
4
+ - 2.1
5
+ - 2.0
6
+ - 1.9.3
7
+ notifications:
8
+ email: false
@@ -1,4 +1,12 @@
1
- ## HEAD
1
+ ## 1.2.0 / 2015-03-21
2
+
3
+ ### Minor Enhancements
4
+
5
+ * Allow variables as parameters (#4)
6
+
7
+ ### Development Fixes
8
+
9
+ * Fix RSpec deprecation warning (#5)
2
10
 
3
11
  ## 1.1.0 / 2014-06-18
4
12
 
@@ -5,6 +5,12 @@ module Jekyll
5
5
  def render(context)
6
6
  if tag_contents = determine_arguments(@markup.strip)
7
7
  gist_id, filename = tag_contents[0], tag_contents[1]
8
+ if context[gist_id]
9
+ gist_id = context[gist_id]
10
+ end
11
+ if context[filename]
12
+ filename = context[filename]
13
+ end
8
14
  gist_script_tag(gist_id, filename)
9
15
  else
10
16
  raise ArgumentError.new <<-eos
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Gist
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -0,0 +1,3 @@
1
+ #! /usr/bin/env bash
2
+
3
+ bundle install
@@ -0,0 +1,3 @@
1
+ #! /usr/bin/env bash
2
+
3
+ bundle exec rspec
@@ -43,6 +43,35 @@ describe(Jekyll::Gist::GistTag) do
43
43
  expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js\?file=#{filename}">\s<\/script>/)
44
44
  end
45
45
  end
46
+
47
+ context "with variable gist id" do
48
+ let(:gist) { "page.gist_id" }
49
+ let(:output) do
50
+ doc.data['gist_id'] = "1342013"
51
+ doc.content = content
52
+ doc.output = Jekyll::Renderer.new(doc.site, doc).run
53
+ end
54
+
55
+ it "produces the correct script tag" do
56
+ expect(output).to match(/<script src="https:\/\/gist.github.com\/#{doc.data['gist_id']}.js">\s<\/script>/)
57
+ end
58
+ end
59
+
60
+ context "with variable gist id and filename" do
61
+ let(:gist) { "page.gist_id" }
62
+ let(:filename) { "page.gist_filename" }
63
+ let(:content) { "{% gist #{gist} #{filename} %}" }
64
+ let(:output) do
65
+ doc.data['gist_id'] = "1342013"
66
+ doc.data['gist_filename'] = "atom.xml"
67
+ doc.content = content
68
+ doc.output = Jekyll::Renderer.new(doc.site, doc).run
69
+ end
70
+
71
+ it "produces the correct script tag" do
72
+ expect(output).to match(/<script src="https:\/\/gist.github.com\/#{doc.data['gist_id']}.js\?file=#{doc.data['gist_filename']}">\s<\/script>/)
73
+ end
74
+ end
46
75
  end
47
76
 
48
77
 
@@ -8,7 +8,6 @@ Jekyll.logger.log_level = :error
8
8
  STDERR.reopen(test(?e, '/dev/null') ? '/dev/null' : 'NUL:')
9
9
 
10
10
  RSpec.configure do |config|
11
- config.treat_symbols_as_metadata_keys_with_true_values = true
12
11
  config.run_all_when_everything_filtered = true
13
12
  config.filter_run :focus
14
13
  config.order = 'random'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-gist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-18 00:00:00.000000000 Z
11
+ date: 2015-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
+ - ".travis.yml"
78
79
  - Gemfile
79
80
  - History.markdown
80
81
  - LICENSE.txt
@@ -84,6 +85,8 @@ files:
84
85
  - lib/jekyll-gist.rb
85
86
  - lib/jekyll-gist/gist_tag.rb
86
87
  - lib/jekyll-gist/version.rb
88
+ - script/bootstrap
89
+ - script/cibuild
87
90
  - spec/gist_tag_spec.rb
88
91
  - spec/spec_helper.rb
89
92
  homepage: https://github.com/jekyll/jekyll-gist