homesteading_helpers 0.0.15 → 0.0.16

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: 0e8beadcff98fb744c725cdd1a6522104cce87b4
4
- data.tar.gz: 6c04d5e1a1df977d950be96550b5c566d74331a2
3
+ metadata.gz: 83246b1e03ca948fffa75e040a506a46dc1a3847
4
+ data.tar.gz: 439fa72a982aba8cd336451e8e47d731cce2aa6b
5
5
  SHA512:
6
- metadata.gz: cf17a556b2e0976ce3f392de38894e7ab67674da60ad7f9ce870b90a81abaf942c66b101816611879bab4113aba4f219ac301b40175582478321a6f16bbc1eb1
7
- data.tar.gz: 01781da707414707234f34f5e6a1db1ac89dbdc9de551c0ca0cec03c110085a8cae0635236e9288af091c0fa1299cf8e9521076a5878ae7612cb6db7973adea7
6
+ metadata.gz: 7ca870b593e614315d67fe26859ec87209d8d37c059636d760ad97c5fc1148f12b35d81fa7db9b76eb5f6cbf1f092d50f09056e174e18575700f6c1d6945d82e
7
+ data.tar.gz: aee7a2d2d991d88cee6e2d91a12715267c30a8e39087213c3c1f23316faf5732526cb1dc05c1b3e1e9b412b68b7061c79555a85bfd3bc7b4d2332917b57a606c
@@ -103,8 +103,7 @@ module HomesteadingHelpers
103
103
  end
104
104
 
105
105
  def logged_in?
106
- # true
107
- false
106
+ Rails.env.development?
108
107
  end
109
108
 
110
109
  def autofocus_value
@@ -209,7 +208,7 @@ module HomesteadingHelpers
209
208
  site_url + "/tags/" + tag.gsub(/ /, "+")
210
209
  end
211
210
 
212
- def license_text
211
+ def license_html
213
212
  output = []
214
213
 
215
214
  # license
@@ -243,5 +242,38 @@ module HomesteadingHelpers
243
242
  output.join(" ").html_safe
244
243
  end
245
244
 
245
+ def license_text
246
+ output = []
247
+
248
+ # license
249
+ license = ::License.find(setting(:license))
250
+
251
+ if license.name == "All Rights Reserved"
252
+ # Default
253
+ output << "#{license.name} #{license.short_code}"
254
+ else
255
+ # Creative Commons and Public Domain (CC0)
256
+ output << "#{license.name} (#{license.short_code})"
257
+ output << license.url
258
+ end
259
+
260
+ # range of years
261
+ years_range = Time.now.year
262
+
263
+ first_post = Post.first
264
+ first_post_year = first_post.nil? ? years_range : first_post.published_at.year
265
+
266
+ if first_post_year == years_range
267
+ output << years_range
268
+ else
269
+ output << "#{first_post_year}&ndash;#{years_range}"
270
+ end
271
+
272
+ # author's name
273
+ output << setting(:author_name)
274
+
275
+ output.join("\n")
276
+ end
277
+
246
278
  end
247
279
  end
@@ -1,3 +1,3 @@
1
1
  module HomesteadingHelpers
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
@@ -20,7 +20,7 @@ Rails.application.configure do
20
20
  # config.action_dispatch.rack_cache = true
21
21
 
22
22
  # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
23
+ config.serve_static_files = false
24
24
 
25
25
  # Compress JavaScripts and CSS.
26
26
  config.assets.js_compressor = :uglifier
@@ -13,7 +13,7 @@ Rails.application.configure do
13
13
  config.eager_load = false
14
14
 
15
15
  # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_assets = true
16
+ config.serve_static_files = true
17
17
  config.static_cache_control = 'public, max-age=3600'
18
18
 
19
19
  # Show full error reports and disable caching.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homesteading_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Becker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-28 00:00:00.000000000 Z
12
+ date: 2015-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  requirements: []
116
116
  rubyforge_project:
117
- rubygems_version: 2.2.2
117
+ rubygems_version: 2.4.6
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: A collection of Rails controller/view helpers shared across multiple Homesteading