mcmire-shoulda-matchers 2.6.1.docs.1 → 2.6.2.docs.1

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: 913c5859d7601cc8a162435e24a1f9d2362a773e
4
- data.tar.gz: 6d4d4fe735c6a340e91af04d75f9607d6f7c6a7f
3
+ metadata.gz: ad1407afc17c1ba5bc2106ad7de5350d831433f2
4
+ data.tar.gz: 991108f5b4e61238c4b73bada789d40c313c5662
5
5
  SHA512:
6
- metadata.gz: edb31670937686252dbb02b9093101d5fde04eb831a078a20c9113da3c9951c1ba108566a49a89a1400c88334c2c4a81181397953c4f59cfde82a08efe952f9f
7
- data.tar.gz: 1456edfcbcc05930e12c5b88b51b10483a18ced6056560c6cd2bf4a996472197afdad588b19b125f7afc0f52fb6226de69709ea87ddf23c0421869caa849fc26
6
+ metadata.gz: 114068cefadda21f30b57bea8609ac6c2d5f3f71866d376c856fb26b2f463d02aed6317d95ffd797f1006c159b4868c1167f0f356b2bc7c7a713bb4c7c61660f
7
+ data.tar.gz: ea5f8e23f8811c5af753c155f685a67cf562f557c1abe93af4e6224580cbe70065a5dc6f45a5eb854876ec917ff3279d25d616003686fa4fc2bf63a6bd65d405
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mcmire-shoulda-matchers (2.6.1.docs.1)
4
+ mcmire-shoulda-matchers (2.6.2.docs.1)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
data/Rakefile CHANGED
@@ -47,22 +47,26 @@ namespace :docs do
47
47
  end
48
48
 
49
49
  desc 'Generate docs for a particular version'
50
- task :generate, [:version, :is_latest] => :setup do |t, args|
51
- latest = (args.is_latest == 'true')
52
- generate_docs(args.version, latest: latest)
50
+ task :generate, [:version, :latest_version] => :setup do |t, args|
51
+ generate_docs(args.version, latest_version: latest_version)
53
52
  end
54
53
 
55
54
  desc 'Generate docs for a particular version and push them to GitHub'
56
- task :publish, [:version, :is_latest] => :setup do |t, args|
57
- latest = (args.is_latest == 'true')
58
- generate_docs(args.version, latest: latest)
59
- publish_docs(args.version, latest: latest)
55
+ task :publish, [:version, :latest_version] => :setup do |t, args|
56
+ generate_docs(args.version, latest_version: latest_version)
57
+ publish_docs(args.version, latest_version: latest_version)
60
58
  end
61
59
 
62
60
  desc "Generate docs for version #{CURRENT_VERSION} and push them to GitHub"
63
61
  task :publish_latest => :setup do
64
- generate_docs(CURRENT_VERSION, latest: true)
65
- publish_docs(CURRENT_VERSION, latest: true)
62
+ version = Gem::Version.new(CURRENT_VERSION)
63
+
64
+ unless version.prerelease?
65
+ latest_version = version.to_s
66
+ end
67
+
68
+ generate_docs(CURRENT_VERSION, latest_version: latest_version)
69
+ publish_docs(CURRENT_VERSION, latest_version: latest_version)
66
70
  end
67
71
 
68
72
  def rewrite_index_to_inject_version(ref, version)
@@ -86,13 +90,13 @@ namespace :docs do
86
90
  sh "git add #{ref}"
87
91
  end
88
92
 
89
- if options[:latest]
90
- generate_file_that_redirects_to_latest_version(ref)
93
+ if options[:latest_version]
94
+ generate_file_that_redirects_to_latest_version(options[:latest_version])
91
95
  end
92
96
  end
93
97
 
94
98
  def publish_docs(version, options = {})
95
- message = build_commit_message(version, options)
99
+ message = build_commit_message(version)
96
100
 
97
101
  within_gh_pages do
98
102
  sh 'git clean -f'
@@ -102,6 +106,9 @@ namespace :docs do
102
106
  end
103
107
 
104
108
  def generate_file_that_redirects_to_latest_version(version)
109
+ ref = determine_ref_from(version)
110
+ locals = { ref: ref }
111
+
105
112
  erb = ERB.new(File.read('doc_config/gh-pages/index.html.erb'))
106
113
 
107
114
  within_gh_pages do
@@ -118,12 +125,8 @@ namespace :docs do
118
125
  end
119
126
  end
120
127
 
121
- def build_commit_message(version, options)
122
- if options[:latest]
123
- "Regenerated docs for latest version #{version}"
124
- else
125
- "Regenerated docs for version #{version}"
126
- end
128
+ def build_commit_message(version)
129
+ "Regenerated docs for version #{version}"
127
130
  end
128
131
 
129
132
  def within_gh_pages(&block)
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>shoulda-matchers Documentation - latest</title>
5
- <meta http-equiv="refresh" content="0;URL=http://mcmire.github.io/shoulda-matchers/<%= version %>">
5
+ <meta http-equiv="refresh" content="0;URL=http://mcmire.github.io/shoulda-matchers/<%= locals[:ref] %>">
6
6
  </head>
7
7
  <body>
8
8
  </body>
@@ -1,6 +1,6 @@
1
1
  module Shoulda
2
2
  module Matchers
3
3
  # @private
4
- VERSION = '2.6.1.docs.1'.freeze
4
+ VERSION = '2.6.2.docs.1'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcmire-shoulda-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1.docs.1
4
+ version: 2.6.2.docs.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tammer Saleh