publishable 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +8 -0
- data/README.rdoc +1 -1
- data/lib/publishable.rb +2 -3
- data/lib/publishable/version.rb +1 -1
- data/publishable.gemspec +12 -6
- data/spec/publishable_spec.rb +4 -4
- metadata +33 -71
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 199486df5736d6d10673c9fa5b7fa8ca0b914927
|
4
|
+
data.tar.gz: 240ca5dfe93d47c8caa60de6c63366f93c395c9b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 85e1707cc27d01e497e4e494f3d7b0657d6c632e8db6221b4dca286469d0eab52e83f9683b6fb98f7f241cbe2e44fed445d8ec2e6c79b40abbe8e5709a9bbeab
|
7
|
+
data.tar.gz: e14f17c5830f578289c8e179ae28963deea9e1e59d4aa4ef2a6f921d84a5915cc5eee2c465b5d0b11c57bf3d40398ebb4e03870f86bc522b865e7397e8c07672
|
data/.travis.yml
ADDED
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= publishable
|
1
|
+
= publishable {<img src="https://travis-ci.org/linki/publishable.png?branch=master" alt="Build Status" />}[https://travis-ci.org/linki/publishable]
|
2
2
|
|
3
3
|
*Publishable* allows a given Boolean, Date, or DateTime column to indicate whether an ActiveRecord
|
4
4
|
model object is "published". This can be used, for example, to schedule a news post to be published
|
data/lib/publishable.rb
CHANGED
@@ -38,9 +38,8 @@ module Publishable
|
|
38
38
|
def publishable(options = {})
|
39
39
|
return unless table_exists?
|
40
40
|
column_name = (options[:on] || :published).to_sym
|
41
|
-
|
42
|
-
|
43
|
-
end
|
41
|
+
# silently ignore a missing column - since bombing on a missing column can make re-running migrations very hard
|
42
|
+
return unless self.columns_hash[column_name.to_s].present?
|
44
43
|
column_type = self.columns_hash[column_name.to_s].type
|
45
44
|
|
46
45
|
if respond_to?(:scope)
|
data/lib/publishable/version.rb
CHANGED
data/publishable.gemspec
CHANGED
@@ -2,14 +2,19 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
$:.push File.expand_path('../lib', __FILE__)
|
6
|
+
|
7
|
+
# Maintain your gem's version:
|
8
|
+
require 'publishable/version'
|
5
9
|
|
6
10
|
Gem::Specification.new do |s|
|
7
11
|
s.name = "publishable"
|
8
|
-
s.version =
|
12
|
+
s.version = Publishable::VERSION.to_s
|
9
13
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
14
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
15
|
s.authors = ["Martin Linkhorst", "\321\202\316\271\316\267\321\203\316\267\317\205\320\274\320\262\321\224\321\217\321\225"]
|
12
|
-
s.date = "2013-
|
16
|
+
s.date = "2013-02-22"
|
17
|
+
s.date = "2013-04-30"
|
13
18
|
s.description = "Provides methods to publish and unpublish your active record models based on a boolean flag, a date, or a datetime. Also adds named scopes to nicely filter your records. Does not touch any controller or views."
|
14
19
|
s.email = ["m.linkhorst@googlemail.com", "info@tinynumbers.com"]
|
15
20
|
s.extra_rdoc_files = [
|
@@ -19,6 +24,7 @@ Gem::Specification.new do |s|
|
|
19
24
|
s.files = [
|
20
25
|
".document",
|
21
26
|
".rspec",
|
27
|
+
".travis.yml",
|
22
28
|
"Gemfile",
|
23
29
|
"Gemfile.lock",
|
24
30
|
"LICENSE.txt",
|
@@ -46,20 +52,20 @@ Gem::Specification.new do |s|
|
|
46
52
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
47
53
|
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
48
54
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
49
|
-
s.add_development_dependency(%q<
|
55
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
50
56
|
else
|
51
57
|
s.add_dependency(%q<yard>, ["~> 0.7"])
|
52
58
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
53
59
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
54
60
|
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
55
|
-
s.add_dependency(%q<
|
61
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
56
62
|
end
|
57
63
|
else
|
58
64
|
s.add_dependency(%q<yard>, ["~> 0.7"])
|
59
65
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
60
66
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
61
67
|
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
62
|
-
s.add_dependency(%q<
|
68
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
63
69
|
end
|
64
70
|
end
|
65
71
|
|
data/spec/publishable_spec.rb
CHANGED
@@ -264,7 +264,7 @@ describe Publishable do
|
|
264
264
|
}.to raise_error ActiveRecord::ConfigurationError
|
265
265
|
end
|
266
266
|
|
267
|
-
it 'should raise a configuration error when the publish column not defined' do
|
267
|
+
it 'should not raise a configuration error when the publish column not defined' do
|
268
268
|
expect {
|
269
269
|
build_model :post do
|
270
270
|
string :title
|
@@ -274,10 +274,10 @@ describe Publishable do
|
|
274
274
|
extend Publishable
|
275
275
|
publishable
|
276
276
|
end
|
277
|
-
}.
|
277
|
+
}.to_not raise_error
|
278
278
|
end
|
279
279
|
|
280
|
-
it 'should raise a configuration error when defined on a missing column' do
|
280
|
+
it 'should not raise a configuration error when defined on a missing column' do
|
281
281
|
expect {
|
282
282
|
build_model :post do
|
283
283
|
string :title
|
@@ -288,7 +288,7 @@ describe Publishable do
|
|
288
288
|
extend Publishable
|
289
289
|
publishable :on => :foobar
|
290
290
|
end
|
291
|
-
}.
|
291
|
+
}.to_not raise_error
|
292
292
|
end
|
293
293
|
|
294
294
|
end
|
metadata
CHANGED
@@ -1,13 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: publishable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
4
|
+
version: 1.0.2
|
11
5
|
platform: ruby
|
12
6
|
authors:
|
13
7
|
- Martin Linkhorst
|
@@ -18,85 +12,59 @@ autorequire:
|
|
18
12
|
bindir: bin
|
19
13
|
cert_chain: []
|
20
14
|
|
21
|
-
date: 2013-
|
15
|
+
date: 2013-04-30 00:00:00 Z
|
22
16
|
dependencies:
|
23
17
|
- !ruby/object:Gem::Dependency
|
24
|
-
|
25
|
-
|
18
|
+
name: yard
|
19
|
+
prerelease: false
|
20
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
21
|
requirements:
|
27
22
|
- - ~>
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 5
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 7
|
33
24
|
version: "0.7"
|
34
|
-
prerelease: false
|
35
25
|
type: :development
|
36
|
-
|
37
|
-
requirement: *id001
|
26
|
+
version_requirements: *id001
|
38
27
|
- !ruby/object:Gem::Dependency
|
39
|
-
|
40
|
-
|
28
|
+
name: rdoc
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
31
|
requirements:
|
42
32
|
- - ~>
|
43
33
|
- !ruby/object:Gem::Version
|
44
|
-
hash: 31
|
45
|
-
segments:
|
46
|
-
- 3
|
47
|
-
- 12
|
48
34
|
version: "3.12"
|
49
|
-
prerelease: false
|
50
35
|
type: :development
|
51
|
-
|
52
|
-
requirement: *id002
|
36
|
+
version_requirements: *id002
|
53
37
|
- !ruby/object:Gem::Dependency
|
54
|
-
|
55
|
-
|
38
|
+
name: bundler
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
41
|
requirements:
|
57
42
|
- - ~>
|
58
43
|
- !ruby/object:Gem::Version
|
59
|
-
hash: 15
|
60
|
-
segments:
|
61
|
-
- 1
|
62
|
-
- 0
|
63
44
|
version: "1.0"
|
64
|
-
prerelease: false
|
65
45
|
type: :development
|
66
|
-
|
67
|
-
requirement: *id003
|
46
|
+
version_requirements: *id003
|
68
47
|
- !ruby/object:Gem::Dependency
|
69
|
-
|
70
|
-
|
48
|
+
name: jeweler
|
49
|
+
prerelease: false
|
50
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
51
|
requirements:
|
72
52
|
- - ~>
|
73
53
|
- !ruby/object:Gem::Version
|
74
|
-
hash: 63
|
75
|
-
segments:
|
76
|
-
- 1
|
77
|
-
- 8
|
78
|
-
- 4
|
79
54
|
version: 1.8.4
|
80
|
-
prerelease: false
|
81
55
|
type: :development
|
82
|
-
|
83
|
-
requirement: *id004
|
56
|
+
version_requirements: *id004
|
84
57
|
- !ruby/object:Gem::Dependency
|
85
|
-
|
86
|
-
|
58
|
+
name: rcov
|
59
|
+
prerelease: false
|
60
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
87
61
|
requirements:
|
88
|
-
-
|
62
|
+
- &id006
|
63
|
+
- ">="
|
89
64
|
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
segments:
|
92
|
-
- 2
|
93
|
-
- 8
|
94
|
-
- 0
|
95
|
-
version: 2.8.0
|
96
|
-
prerelease: false
|
65
|
+
version: "0"
|
97
66
|
type: :development
|
98
|
-
|
99
|
-
requirement: *id005
|
67
|
+
version_requirements: *id005
|
100
68
|
description: Provides methods to publish and unpublish your active record models based on a boolean flag, a date, or a datetime. Also adds named scopes to nicely filter your records. Does not touch any controller or views.
|
101
69
|
email:
|
102
70
|
- m.linkhorst@googlemail.com
|
@@ -111,6 +79,7 @@ extra_rdoc_files:
|
|
111
79
|
files:
|
112
80
|
- .document
|
113
81
|
- .rspec
|
82
|
+
- .travis.yml
|
114
83
|
- Gemfile
|
115
84
|
- Gemfile.lock
|
116
85
|
- LICENSE.txt
|
@@ -126,35 +95,28 @@ files:
|
|
126
95
|
homepage: http://github.com/linki/publishable
|
127
96
|
licenses:
|
128
97
|
- MIT
|
98
|
+
metadata: {}
|
99
|
+
|
129
100
|
post_install_message:
|
130
101
|
rdoc_options: []
|
131
102
|
|
132
103
|
require_paths:
|
133
104
|
- lib
|
134
105
|
required_ruby_version: !ruby/object:Gem::Requirement
|
135
|
-
none: false
|
136
106
|
requirements:
|
137
|
-
-
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
hash: 3
|
140
|
-
segments:
|
141
|
-
- 0
|
142
|
-
version: "0"
|
107
|
+
- *id006
|
143
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
-
none: false
|
145
109
|
requirements:
|
146
|
-
- - "
|
110
|
+
- - ">"
|
147
111
|
- !ruby/object:Gem::Version
|
148
|
-
|
149
|
-
segments:
|
150
|
-
- 0
|
151
|
-
version: "0"
|
112
|
+
version: 1.3.1
|
152
113
|
requirements: []
|
153
114
|
|
154
115
|
rubyforge_project:
|
155
|
-
rubygems_version:
|
116
|
+
rubygems_version: 2.0.3
|
156
117
|
signing_key:
|
157
118
|
specification_version: 3
|
158
119
|
summary: Adds publishing functionality to your active record model
|
159
120
|
test_files: []
|
160
121
|
|
122
|
+
has_rdoc:
|