publishable 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6c038fd6e3a4bb8ac14e8f76b195975e377bcb87
4
+ data.tar.gz: 74617392828154271ca71e941cb8ca6c40d00356
5
+ SHA512:
6
+ metadata.gz: d48b78cd595610f4b5e55438e41af0479fdda2745b7932d3b34758c41a3ebf01c43bd1ae039329b9f4dd54262d27315fb35e11189dc27b3e6f1938715190ffcc
7
+ data.tar.gz: 6560391bd5e7eb355672fb314b28f24959ab2863706702ff31688c020ee2254c85e2255f21c55f84cade74fb2781a687ab3ceb539ab2fecf6cdc76d5ede4a196
@@ -3,4 +3,4 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.3
5
5
  - 2.0.0
6
- - 2.1.1
6
+ - 2.1.3
data/Gemfile CHANGED
@@ -15,7 +15,7 @@ group :development, :test do
15
15
  gem "bundler", "~> 1.0"
16
16
 
17
17
  # Use Jeweler to build our gem
18
- gem "jeweler", "~> 1.8.4"
18
+ gem "jeweler", "~> 2.0.1"
19
19
 
20
20
  # RSpec for our testing framework
21
21
  gem "rspec", "~> 2.8.0"
@@ -34,4 +34,4 @@ group :test do
34
34
 
35
35
  # Test time-dependent functionality
36
36
  gem 'timecop'
37
- end
37
+ end
@@ -15,21 +15,50 @@ GEM
15
15
  acts_as_fu (0.0.8)
16
16
  activerecord
17
17
  sqlite3
18
+ addressable (2.3.6)
18
19
  arel (3.0.2)
19
20
  builder (3.0.4)
20
21
  diff-lcs (1.1.3)
22
+ faraday (0.8.9)
23
+ multipart-post (~> 1.2.0)
21
24
  ffaker (1.15.0)
22
- git (1.2.5)
25
+ git (1.2.8)
26
+ github_api (0.10.2)
27
+ addressable
28
+ faraday (~> 0.8.7)
29
+ hashie (>= 1.2)
30
+ multi_json (~> 1.4)
31
+ nokogiri (~> 1.6.0)
32
+ oauth2
33
+ hashie (3.3.1)
34
+ highline (1.6.21)
23
35
  i18n (0.6.1)
24
- jeweler (1.8.4)
25
- bundler (~> 1.0)
36
+ jeweler (2.0.1)
37
+ builder
38
+ bundler (>= 1.0)
26
39
  git (>= 1.2.5)
40
+ github_api
41
+ highline (>= 1.6.15)
42
+ nokogiri (>= 1.5.10)
27
43
  rake
28
44
  rdoc
29
- json (1.7.7)
45
+ json (1.8.1)
46
+ jwt (1.0.0)
47
+ mini_portile (0.6.0)
30
48
  multi_json (1.6.1)
31
- rake (10.0.3)
32
- rdoc (3.12.1)
49
+ multi_xml (0.5.5)
50
+ multipart-post (1.2.0)
51
+ nokogiri (1.6.3.1)
52
+ mini_portile (= 0.6.0)
53
+ oauth2 (1.0.0)
54
+ faraday (>= 0.8, < 0.10)
55
+ jwt (~> 1.0)
56
+ multi_json (~> 1.3)
57
+ multi_xml (~> 0.5)
58
+ rack (~> 1.2)
59
+ rack (1.5.2)
60
+ rake (10.3.2)
61
+ rdoc (3.12.2)
33
62
  json (~> 1.4)
34
63
  rspec (2.8.0)
35
64
  rspec-core (~> 2.8.0)
@@ -51,7 +80,7 @@ DEPENDENCIES
51
80
  acts_as_fu
52
81
  bundler (~> 1.0)
53
82
  ffaker
54
- jeweler (~> 1.8.4)
83
+ jeweler (~> 2.0.1)
55
84
  rdoc (~> 3.12)
56
85
  rspec (~> 2.8.0)
57
86
  timecop
@@ -119,6 +119,7 @@ module Publishable
119
119
 
120
120
  def unpublish()
121
121
  self.#{column_name} = nil
122
+ true
122
123
  end
123
124
 
124
125
  def unpublish!()
@@ -18,7 +18,7 @@ module Publishable
18
18
  MINOR = 0
19
19
 
20
20
  # The patch-level, incremented for minor bug fixes / patches.
21
- PATCH = 3
21
+ PATCH = 4
22
22
 
23
23
  # Prerelease specification for e.g. "alpha", "beta.1", etc
24
24
  PRERELEASE = nil
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
15
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", "Andrew Janssen"]
16
- s.date = "2014-03-04"
16
+ s.date = "2014-10-05"
17
17
  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."
18
18
  s.email = ["m.linkhorst@googlemail.com", "info@tinynumbers.com", "andrew.janssen@sardiusgroup.com"]
19
19
  s.extra_rdoc_files = [
@@ -64,4 +64,3 @@ Gem::Specification.new do |s|
64
64
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
65
65
  end
66
66
  end
67
-
@@ -307,4 +307,37 @@ describe Publishable do
307
307
 
308
308
  end
309
309
 
310
+ describe "unpublish!" do
311
+ before :all do
312
+ build_model :post do
313
+ string :title
314
+ text :body
315
+ boolean :published
316
+ attr_accessible :title, :body, :published
317
+ validates :body, :title, :presence => true
318
+ extend Publishable
319
+ publishable
320
+ end
321
+ end
322
+
323
+ let(:post) do
324
+ Post.create(
325
+ :title => Faker::Lorem.sentence(4),
326
+ :body => Faker::Lorem.paragraphs(3).join("\n"),
327
+ :published => true
328
+ )
329
+ end
330
+
331
+ before :each do
332
+ post.should be_valid
333
+ post.should be_published
334
+ end
335
+
336
+ it 'saves the post after calling unpublish!' do
337
+ post.unpublish!
338
+ post.should_not be_published
339
+ post.should_not be_changed
340
+ end
341
+ end
342
+
310
343
  end
metadata CHANGED
@@ -1,96 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publishable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
5
- prerelease:
4
+ version: 1.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Martin Linkhorst
9
- - тιηуηυмвєяѕ
8
+ - "тιηуηυмвєяѕ"
10
9
  - Andrew Janssen
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2014-03-04 00:00:00.000000000 Z
13
+ date: 2014-10-05 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: yard
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ~>
19
+ - - "~>"
22
20
  - !ruby/object:Gem::Version
23
21
  version: '0.7'
24
22
  type: :development
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ~>
26
+ - - "~>"
30
27
  - !ruby/object:Gem::Version
31
28
  version: '0.7'
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: rdoc
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ~>
33
+ - - "~>"
38
34
  - !ruby/object:Gem::Version
39
35
  version: '3.12'
40
36
  type: :development
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ~>
40
+ - - "~>"
46
41
  - !ruby/object:Gem::Version
47
42
  version: '3.12'
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: bundler
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
- - - ~>
47
+ - - "~>"
54
48
  - !ruby/object:Gem::Version
55
49
  version: '1.0'
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
- - - ~>
54
+ - - "~>"
62
55
  - !ruby/object:Gem::Version
63
56
  version: '1.0'
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: jeweler
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
- - - ~>
61
+ - - "~>"
70
62
  - !ruby/object:Gem::Version
71
- version: 1.8.4
63
+ version: 2.0.1
72
64
  type: :development
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
- - - ~>
68
+ - - "~>"
78
69
  - !ruby/object:Gem::Version
79
- version: 1.8.4
70
+ version: 2.0.1
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: rspec
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
- - - ~>
75
+ - - "~>"
86
76
  - !ruby/object:Gem::Version
87
77
  version: 2.8.0
88
78
  type: :development
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
- - - ~>
82
+ - - "~>"
94
83
  - !ruby/object:Gem::Version
95
84
  version: 2.8.0
96
85
  description: Provides methods to publish and unpublish your active record models based
@@ -105,9 +94,9 @@ extra_rdoc_files:
105
94
  - LICENSE.txt
106
95
  - README.rdoc
107
96
  files:
108
- - .document
109
- - .rspec
110
- - .travis.yml
97
+ - ".document"
98
+ - ".rspec"
99
+ - ".travis.yml"
111
100
  - Gemfile
112
101
  - Gemfile.lock
113
102
  - LICENSE.txt
@@ -123,29 +112,25 @@ files:
123
112
  homepage: http://github.com/linki/publishable
124
113
  licenses:
125
114
  - MIT
115
+ metadata: {}
126
116
  post_install_message:
127
117
  rdoc_options: []
128
118
  require_paths:
129
119
  - lib
130
120
  required_ruby_version: !ruby/object:Gem::Requirement
131
- none: false
132
121
  requirements:
133
- - - ! '>='
122
+ - - ">="
134
123
  - !ruby/object:Gem::Version
135
124
  version: '0'
136
- segments:
137
- - 0
138
- hash: -3050157289836478071
139
125
  required_rubygems_version: !ruby/object:Gem::Requirement
140
- none: false
141
126
  requirements:
142
- - - ! '>='
127
+ - - ">="
143
128
  - !ruby/object:Gem::Version
144
129
  version: '0'
145
130
  requirements: []
146
131
  rubyforge_project:
147
- rubygems_version: 1.8.23.2
132
+ rubygems_version: 2.2.2
148
133
  signing_key:
149
- specification_version: 3
134
+ specification_version: 4
150
135
  summary: Adds publishing functionality to your active record model
151
136
  test_files: []