publishable 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +2 -1
- data/.rspec +2 -0
- data/Gemfile +43 -0
- data/Gemfile.lock +60 -0
- data/{LICENSE → LICENSE.txt} +1 -0
- data/README.rdoc +87 -0
- data/Rakefile +30 -28
- data/lib/publishable.rb +252 -20
- data/lib/publishable/railtie.rb +2 -0
- data/lib/publishable/version.rb +40 -0
- data/publishable.gemspec +41 -33
- data/spec/publishable_spec.rb +281 -83
- data/spec/spec_helper.rb +27 -7
- data/spec/support/matcher_each.rb +12 -0
- metadata +98 -30
- data/.gitignore +0 -22
- data/README.textile +0 -29
- data/VERSION +0 -1
- data/db/schema.rb +0 -8
- data/spec/spec.opts +0 -2
data/spec/spec_helper.rb
CHANGED
@@ -1,11 +1,31 @@
|
|
1
|
-
|
1
|
+
ENV['RAILS_ENV'] ||= 'test'
|
2
|
+
|
3
|
+
if RUBY_VERSION > '1.9'
|
4
|
+
require 'simplecov'
|
5
|
+
SimpleCov.start
|
6
|
+
end
|
7
|
+
|
8
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
9
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
10
|
+
|
11
|
+
require 'ffaker'
|
12
|
+
require 'acts_as_fu'
|
13
|
+
require 'rspec'
|
14
|
+
require 'timecop'
|
2
15
|
require 'publishable'
|
3
|
-
require 'spec'
|
4
|
-
require 'spec/autorun'
|
5
16
|
|
6
|
-
|
7
|
-
|
17
|
+
# Requires supporting files with custom matchers and macros, etc,
|
18
|
+
# in ./support/ and its subdirectories.
|
19
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
20
|
+
|
21
|
+
RSpec.configure do |config|
|
22
|
+
|
23
|
+
config.include ActsAsFu
|
24
|
+
|
25
|
+
# Run specs in random order to surface order dependencies. If you find an
|
26
|
+
# order dependency and want to debug it, you can fix the order by providing
|
27
|
+
# the seed, which is printed after each run.
|
28
|
+
# --seed 1234
|
29
|
+
config.order = 'random'
|
8
30
|
|
9
|
-
Spec::Runner.configure do |config|
|
10
|
-
config.mock_with :mocha
|
11
31
|
end
|
metadata
CHANGED
@@ -1,67 +1,134 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: publishable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
5
6
|
segments:
|
7
|
+
- 1
|
6
8
|
- 0
|
7
|
-
- 3
|
8
9
|
- 0
|
9
|
-
version: 0.
|
10
|
+
version: 1.0.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Martin Linkhorst
|
14
|
+
- !binary |
|
15
|
+
0YLOuc630YPOt8+F0LzQstGU0Y/RlQ==
|
16
|
+
|
13
17
|
autorequire:
|
14
18
|
bindir: bin
|
15
19
|
cert_chain: []
|
16
20
|
|
17
|
-
date:
|
18
|
-
default_executable:
|
21
|
+
date: 2013-03-07 00:00:00 Z
|
19
22
|
dependencies:
|
20
23
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 5
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 7
|
33
|
+
version: "0.7"
|
34
|
+
prerelease: false
|
35
|
+
type: :development
|
36
|
+
name: yard
|
37
|
+
requirement: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 31
|
45
|
+
segments:
|
46
|
+
- 3
|
47
|
+
- 12
|
48
|
+
version: "3.12"
|
49
|
+
prerelease: false
|
50
|
+
type: :development
|
51
|
+
name: rdoc
|
52
|
+
requirement: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ~>
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 15
|
60
|
+
segments:
|
61
|
+
- 1
|
62
|
+
- 0
|
63
|
+
version: "1.0"
|
22
64
|
prerelease: false
|
23
|
-
|
65
|
+
type: :development
|
66
|
+
name: bundler
|
67
|
+
requirement: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
24
70
|
none: false
|
25
71
|
requirements:
|
26
|
-
- -
|
72
|
+
- - ~>
|
27
73
|
- !ruby/object:Gem::Version
|
74
|
+
hash: 63
|
28
75
|
segments:
|
29
76
|
- 1
|
77
|
+
- 8
|
78
|
+
- 4
|
79
|
+
version: 1.8.4
|
80
|
+
prerelease: false
|
81
|
+
type: :development
|
82
|
+
name: jeweler
|
83
|
+
requirement: *id004
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 47
|
91
|
+
segments:
|
30
92
|
- 2
|
31
|
-
-
|
32
|
-
|
93
|
+
- 8
|
94
|
+
- 0
|
95
|
+
version: 2.8.0
|
96
|
+
prerelease: false
|
33
97
|
type: :development
|
34
|
-
|
35
|
-
|
36
|
-
|
98
|
+
name: rspec
|
99
|
+
requirement: *id005
|
100
|
+
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
|
+
email:
|
102
|
+
- m.linkhorst@googlemail.com
|
103
|
+
- info@tinynumbers.com
|
37
104
|
executables: []
|
38
105
|
|
39
106
|
extensions: []
|
40
107
|
|
41
108
|
extra_rdoc_files:
|
42
|
-
- LICENSE
|
43
|
-
- README.
|
109
|
+
- LICENSE.txt
|
110
|
+
- README.rdoc
|
44
111
|
files:
|
45
112
|
- .document
|
46
|
-
- .
|
47
|
-
-
|
48
|
-
-
|
113
|
+
- .rspec
|
114
|
+
- Gemfile
|
115
|
+
- Gemfile.lock
|
116
|
+
- LICENSE.txt
|
117
|
+
- README.rdoc
|
49
118
|
- Rakefile
|
50
|
-
- VERSION
|
51
|
-
- db/schema.rb
|
52
119
|
- lib/publishable.rb
|
53
120
|
- lib/publishable/railtie.rb
|
121
|
+
- lib/publishable/version.rb
|
54
122
|
- publishable.gemspec
|
55
123
|
- spec/publishable_spec.rb
|
56
|
-
- spec/spec.opts
|
57
124
|
- spec/spec_helper.rb
|
58
|
-
|
125
|
+
- spec/support/matcher_each.rb
|
59
126
|
homepage: http://github.com/linki/publishable
|
60
|
-
licenses:
|
61
|
-
|
127
|
+
licenses:
|
128
|
+
- MIT
|
62
129
|
post_install_message:
|
63
|
-
rdoc_options:
|
64
|
-
|
130
|
+
rdoc_options: []
|
131
|
+
|
65
132
|
require_paths:
|
66
133
|
- lib
|
67
134
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -69,6 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
136
|
requirements:
|
70
137
|
- - ">="
|
71
138
|
- !ruby/object:Gem::Version
|
139
|
+
hash: 3
|
72
140
|
segments:
|
73
141
|
- 0
|
74
142
|
version: "0"
|
@@ -77,16 +145,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
145
|
requirements:
|
78
146
|
- - ">="
|
79
147
|
- !ruby/object:Gem::Version
|
148
|
+
hash: 3
|
80
149
|
segments:
|
81
150
|
- 0
|
82
151
|
version: "0"
|
83
152
|
requirements: []
|
84
153
|
|
85
154
|
rubyforge_project:
|
86
|
-
rubygems_version: 1.
|
155
|
+
rubygems_version: 1.8.24
|
87
156
|
signing_key:
|
88
157
|
specification_version: 3
|
89
158
|
summary: Adds publishing functionality to your active record model
|
90
|
-
test_files:
|
91
|
-
|
92
|
-
- spec/spec_helper.rb
|
159
|
+
test_files: []
|
160
|
+
|
data/.gitignore
DELETED
data/README.textile
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
h1. Publishable
|
2
|
-
|
3
|
-
<pre>
|
4
|
-
gem install publishable
|
5
|
-
</pre>
|
6
|
-
|
7
|
-
h2. Setup
|
8
|
-
|
9
|
-
you need a datetime column called published_at in your table and call publishable in your class body
|
10
|
-
|
11
|
-
<pre>
|
12
|
-
class Album < ActiveRecord::Base
|
13
|
-
publishable
|
14
|
-
end
|
15
|
-
</pre>
|
16
|
-
|
17
|
-
h2. Methods
|
18
|
-
|
19
|
-
<pre>
|
20
|
-
album = Album.new
|
21
|
-
|
22
|
-
album.published? # => false
|
23
|
-
album.publish! # calls :save afterwards
|
24
|
-
album.published? # => true
|
25
|
-
|
26
|
-
Album.published.all # => finds all published albums
|
27
|
-
</pre>
|
28
|
-
|
29
|
-
Copyright (c) 2010 Martin Linkhorst, released under the MIT license.
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.3.0
|
data/db/schema.rb
DELETED
data/spec/spec.opts
DELETED