dm-is-published 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/{History.txt → History.rdoc} +0 -0
- data/README.rdoc +2 -2
- data/Rakefile +28 -8
- data/VERSION +1 -1
- data/dm-is-published.gemspec +6 -6
- data/lib/dm-is-published/is/published.rb +11 -8
- data/lib/dm-is-published/is/version.rb +1 -1
- data/spec/integration/published_spec.rb +9 -0
- metadata +6 -6
data/.gitignore
CHANGED
File without changes
|
data/README.rdoc
CHANGED
@@ -100,9 +100,9 @@ As I said above, for a better understanding of this gem/plugin, make sure you st
|
|
100
100
|
== Errors / Bugs
|
101
101
|
|
102
102
|
If something is not behaving intuitively, it is a bug, and should be reported.
|
103
|
-
Report it here: http://
|
103
|
+
Report it here: http://github.com/kematzy/dm-is-published/issues
|
104
104
|
|
105
|
-
|
105
|
+
== Credits
|
106
106
|
|
107
107
|
Copyright (c) 2009-07-11 [kematzy gmail com]
|
108
108
|
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ begin
|
|
12
12
|
gem.email = "kematzy@gmail.com"
|
13
13
|
gem.homepage = "http://github.com/kematzy/dm-is-published"
|
14
14
|
gem.authors = ["kematzy"]
|
15
|
-
gem.extra_rdoc_files = %w[ README.rdoc LICENSE TODO History.
|
15
|
+
gem.extra_rdoc_files = %w[ README.rdoc LICENSE TODO History.rdoc ]
|
16
16
|
gem.add_dependency('dm-core', '>= 0.10.0')
|
17
17
|
gem.add_dependency('dm-validations', '>= 0.10.0')
|
18
18
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
@@ -39,16 +39,36 @@ task :default => :spec
|
|
39
39
|
|
40
40
|
require 'rake/rdoctask'
|
41
41
|
Rake::RDocTask.new do |rdoc|
|
42
|
-
|
43
|
-
|
44
|
-
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
45
|
-
else
|
46
|
-
version = ""
|
47
|
-
end
|
48
|
-
|
42
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
43
|
+
|
49
44
|
rdoc.rdoc_dir = 'rdoc'
|
50
45
|
rdoc.title = "dm-is-published #{version}"
|
51
46
|
rdoc.rdoc_files.include('README*')
|
52
47
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
48
|
end
|
54
49
|
|
50
|
+
|
51
|
+
desc 'Build the rdoc HTML Files'
|
52
|
+
task :docs do
|
53
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
54
|
+
sh "sdoc -N --title 'DM::Is::Published v#{version}' lib/dm-is-published"
|
55
|
+
end
|
56
|
+
|
57
|
+
namespace :docs do
|
58
|
+
|
59
|
+
desc 'Remove rdoc products'
|
60
|
+
task :remove => [:clobber_rdoc] do |variable|
|
61
|
+
sh "rm -rf doc"
|
62
|
+
end
|
63
|
+
|
64
|
+
desc 'Force a rebuild of the RDOC files'
|
65
|
+
task :rebuild => [:docs]
|
66
|
+
|
67
|
+
desc 'Build docs, and open in browser for viewing (specify BROWSER)'
|
68
|
+
task :open => [:docs] do
|
69
|
+
browser = ENV["BROWSER"] || "safari"
|
70
|
+
sh "open -a #{browser} doc/index.html"
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/dm-is-published.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{dm-is-published}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["kematzy"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-08-20}
|
10
10
|
s.description = %q{= dm-is-published
|
11
11
|
|
12
12
|
This plugin makes it very easy to add different states to your models, like 'draft' vs 'live'.
|
@@ -109,9 +109,9 @@ As I said above, for a better understanding of this gem/plugin, make sure you st
|
|
109
109
|
== Errors / Bugs
|
110
110
|
|
111
111
|
If something is not behaving intuitively, it is a bug, and should be reported.
|
112
|
-
Report it here: http://
|
112
|
+
Report it here: http://github.com/kematzy/dm-is-published/issues
|
113
113
|
|
114
|
-
|
114
|
+
== Credits
|
115
115
|
|
116
116
|
Copyright (c) 2009-07-11 [kematzy gmail com]
|
117
117
|
|
@@ -123,14 +123,14 @@ Released under the MIT license.
|
|
123
123
|
}
|
124
124
|
s.email = %q{kematzy@gmail.com}
|
125
125
|
s.extra_rdoc_files = [
|
126
|
-
"History.
|
126
|
+
"History.rdoc",
|
127
127
|
"LICENSE",
|
128
128
|
"README.rdoc",
|
129
129
|
"TODO"
|
130
130
|
]
|
131
131
|
s.files = [
|
132
132
|
".gitignore",
|
133
|
-
"History.
|
133
|
+
"History.rdoc",
|
134
134
|
"LICENSE",
|
135
135
|
"README.rdoc",
|
136
136
|
"Rakefile",
|
@@ -99,9 +99,9 @@ module DataMapper
|
|
99
99
|
# == Errors / Bugs
|
100
100
|
#
|
101
101
|
# If something is not behaving intuitively, it is a bug, and should be reported.
|
102
|
-
# Report it here: http://
|
102
|
+
# Report it here: http://github.com/kematzy/dm-is-published/issues
|
103
103
|
#
|
104
|
-
#
|
104
|
+
# == Credits
|
105
105
|
#
|
106
106
|
# Copyright (c) 2008-05-07 [Kematzy at gmail]
|
107
107
|
#
|
@@ -203,18 +203,21 @@ module DataMapper
|
|
203
203
|
# -- (Hash) => all(:key => "value") ( normal operations, so just pass on the Hash )
|
204
204
|
# -- (Symbol) => all(:draft) ( just get the symbol, )
|
205
205
|
# -- (Symbol, Hash ) => :draft, { extra options }
|
206
|
+
# -- (DataMapper somethings) => leave it alone
|
206
207
|
if args.empty?
|
207
208
|
return super
|
208
|
-
elsif args.first.is_a?(
|
209
|
-
return super(args.first)
|
210
|
-
else
|
209
|
+
elsif args.first.is_a?(Symbol)
|
211
210
|
# set the from args Array, remove first item if Symbol, and then check for 2nd item's presence
|
212
|
-
state, options = args.shift.to_s, (args.blank? ? {} : args.first)
|
211
|
+
state, options = args.shift.to_s, (args.blank? ? {} : args.first)
|
213
212
|
# puts " and state=[#{state}] and options=[#{options.class}] options.inspect=[#{options.inspect}] [#{__FILE__}:#{__LINE__}]"
|
214
|
-
|
215
213
|
return super({ :publish_status => state }.merge(options) )
|
214
|
+
elsif args.first.is_a?(Hash)
|
215
|
+
# puts "dm-is-published args.first was a HASH ] [#{__FILE__}:#{__LINE__}]"
|
216
|
+
return super(args.first)
|
217
|
+
else
|
218
|
+
# puts "dm-is-published (ELSE) [#{__FILE__}:#{__LINE__}]"
|
219
|
+
return super
|
216
220
|
end
|
217
|
-
|
218
221
|
end
|
219
222
|
|
220
223
|
end # ClassMethods
|
@@ -161,6 +161,15 @@ if HAS_SQLITE3 || HAS_MYSQL || HAS_POSTGRES
|
|
161
161
|
|
162
162
|
end #/ #self.all
|
163
163
|
|
164
|
+
describe "#first" do
|
165
|
+
|
166
|
+
it "should description" do
|
167
|
+
# Article.first.should == ''
|
168
|
+
# Article.first(:title => "Live Article").should == ''
|
169
|
+
end
|
170
|
+
|
171
|
+
end #/ #first
|
172
|
+
|
164
173
|
end #/ Class Methods
|
165
174
|
|
166
175
|
describe "Instance Methods" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-is-published
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kematzy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-08-20 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -135,9 +135,9 @@ description: |
|
|
135
135
|
== Errors / Bugs
|
136
136
|
|
137
137
|
If something is not behaving intuitively, it is a bug, and should be reported.
|
138
|
-
Report it here: http://
|
138
|
+
Report it here: http://github.com/kematzy/dm-is-published/issues
|
139
139
|
|
140
|
-
|
140
|
+
== Credits
|
141
141
|
|
142
142
|
Copyright (c) 2009-07-11 [kematzy gmail com]
|
143
143
|
|
@@ -153,13 +153,13 @@ executables: []
|
|
153
153
|
extensions: []
|
154
154
|
|
155
155
|
extra_rdoc_files:
|
156
|
-
- History.
|
156
|
+
- History.rdoc
|
157
157
|
- LICENSE
|
158
158
|
- README.rdoc
|
159
159
|
- TODO
|
160
160
|
files:
|
161
161
|
- .gitignore
|
162
|
-
- History.
|
162
|
+
- History.rdoc
|
163
163
|
- LICENSE
|
164
164
|
- README.rdoc
|
165
165
|
- Rakefile
|