publish 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ rvm:
2
+ - 1.9.2
3
+ - 1.9.3
4
+ - ruby-head
5
+ - rbx-18mode
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rails", "3.0.11"
4
- gem "capybara", ">= 1.1.1"
3
+ gem "rails", "3.0.12"
4
+ gem "capybara"
5
5
 
6
6
  gem "bson_ext"
7
7
 
data/Gemfile.lock CHANGED
@@ -1,121 +1,121 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- publish (0.0.4)
4
+ publish (0.0.5)
5
5
  mongoid (>= 2.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
10
  abstract (1.0.0)
11
- actionmailer (3.0.11)
12
- actionpack (= 3.0.11)
11
+ actionmailer (3.0.12)
12
+ actionpack (= 3.0.12)
13
13
  mail (~> 2.2.19)
14
- actionpack (3.0.11)
15
- activemodel (= 3.0.11)
16
- activesupport (= 3.0.11)
14
+ actionpack (3.0.12)
15
+ activemodel (= 3.0.12)
16
+ activesupport (= 3.0.12)
17
17
  builder (~> 2.1.2)
18
18
  erubis (~> 2.6.6)
19
19
  i18n (~> 0.5.0)
20
- rack (~> 1.2.1)
20
+ rack (~> 1.2.5)
21
21
  rack-mount (~> 0.6.14)
22
22
  rack-test (~> 0.5.7)
23
23
  tzinfo (~> 0.3.23)
24
- activemodel (3.0.11)
25
- activesupport (= 3.0.11)
24
+ activemodel (3.0.12)
25
+ activesupport (= 3.0.12)
26
26
  builder (~> 2.1.2)
27
27
  i18n (~> 0.5.0)
28
- activerecord (3.0.11)
29
- activemodel (= 3.0.11)
30
- activesupport (= 3.0.11)
28
+ activerecord (3.0.12)
29
+ activemodel (= 3.0.12)
30
+ activesupport (= 3.0.12)
31
31
  arel (~> 2.0.10)
32
32
  tzinfo (~> 0.3.23)
33
- activeresource (3.0.11)
34
- activemodel (= 3.0.11)
35
- activesupport (= 3.0.11)
36
- activesupport (3.0.11)
33
+ activeresource (3.0.12)
34
+ activemodel (= 3.0.12)
35
+ activesupport (= 3.0.12)
36
+ activesupport (3.0.12)
37
37
  arel (2.0.10)
38
- bson (1.5.1)
39
- bson_ext (1.4.0)
38
+ bson (1.6.0)
39
+ bson_ext (1.6.0)
40
+ bson (= 1.6.0)
40
41
  builder (2.1.2)
41
- capybara (1.1.1)
42
+ capybara (1.1.2)
42
43
  mime-types (>= 1.16)
43
44
  nokogiri (>= 1.3.3)
44
45
  rack (>= 1.0.0)
45
46
  rack-test (>= 0.5.4)
46
47
  selenium-webdriver (~> 2.0)
47
48
  xpath (~> 0.1.4)
48
- childprocess (0.2.2)
49
+ childprocess (0.3.1)
49
50
  ffi (~> 1.0.6)
50
- colorific (1.0.1)
51
- minitest (~> 2.6.2)
51
+ colorific (1.0.2)
52
+ minitest (~> 2.8.0)
52
53
  ruby-progressbar (~> 0.0.10)
53
54
  erubis (2.6.6)
54
55
  abstract (>= 1.0.0)
55
- factory_girl (2.2.0)
56
- activesupport
57
- factory_girl_rails (1.3.0)
58
- factory_girl (~> 2.2.0)
56
+ factory_girl (2.6.1)
57
+ activesupport (>= 2.3.9)
58
+ factory_girl_rails (1.7.0)
59
+ factory_girl (~> 2.6.0)
59
60
  railties (>= 3.0.0)
60
- ffaker (1.9.1)
61
- ffi (1.0.9)
61
+ ffaker (1.13.0)
62
+ ffi (1.0.11)
62
63
  i18n (0.5.0)
63
- json (1.6.3)
64
- json_pure (1.6.1)
64
+ json (1.6.5)
65
65
  mail (2.2.19)
66
66
  activesupport (>= 2.3.6)
67
67
  i18n (>= 0.4.0)
68
68
  mime-types (~> 1.16)
69
69
  treetop (~> 1.4.8)
70
70
  mime-types (1.17.2)
71
- minitest (2.6.2)
72
- mongo (1.5.1)
73
- bson (= 1.5.1)
74
- mongoid (2.2.4)
75
- activemodel (~> 3.0)
71
+ minitest (2.8.1)
72
+ mongo (1.6.0)
73
+ bson (= 1.6.0)
74
+ mongoid (2.2.6)
75
+ activemodel (~> 3.0.0)
76
76
  mongo (~> 1.3)
77
77
  tzinfo (~> 0.3.22)
78
- multi_json (1.0.3)
78
+ multi_json (1.1.0)
79
79
  nokogiri (1.5.0)
80
80
  polyglot (0.3.3)
81
- rack (1.2.4)
81
+ rack (1.2.5)
82
82
  rack-mount (0.6.14)
83
83
  rack (>= 1.0.0)
84
84
  rack-test (0.5.7)
85
85
  rack (>= 1.0)
86
- rails (3.0.11)
87
- actionmailer (= 3.0.11)
88
- actionpack (= 3.0.11)
89
- activerecord (= 3.0.11)
90
- activeresource (= 3.0.11)
91
- activesupport (= 3.0.11)
86
+ rails (3.0.12)
87
+ actionmailer (= 3.0.12)
88
+ actionpack (= 3.0.12)
89
+ activerecord (= 3.0.12)
90
+ activeresource (= 3.0.12)
91
+ activesupport (= 3.0.12)
92
92
  bundler (~> 1.0)
93
- railties (= 3.0.11)
94
- railties (3.0.11)
95
- actionpack (= 3.0.11)
96
- activesupport (= 3.0.11)
93
+ railties (= 3.0.12)
94
+ railties (3.0.12)
95
+ actionpack (= 3.0.12)
96
+ activesupport (= 3.0.12)
97
97
  rake (>= 0.8.7)
98
98
  rdoc (~> 3.4)
99
99
  thor (~> 0.14.4)
100
100
  rake (0.9.2.2)
101
- rdoc (3.11)
101
+ rdoc (3.12)
102
102
  json (~> 1.4)
103
103
  ruby-progressbar (0.0.10)
104
- rubyzip (0.9.4)
105
- selenium-webdriver (2.10.0)
106
- childprocess (>= 0.2.1)
107
- ffi (= 1.0.9)
108
- json_pure
104
+ rubyzip (0.9.6.1)
105
+ selenium-webdriver (2.20.0)
106
+ childprocess (>= 0.2.5)
107
+ ffi (~> 1.0)
108
+ multi_json (~> 1.0)
109
109
  rubyzip
110
- simplecov (0.5.4)
111
- multi_json (~> 1.0.3)
110
+ simplecov (0.6.1)
111
+ multi_json (~> 1.0)
112
112
  simplecov-html (~> 0.5.3)
113
113
  simplecov-html (0.5.3)
114
114
  thor (0.14.6)
115
115
  treetop (1.4.10)
116
116
  polyglot
117
117
  polyglot (>= 0.3.1)
118
- tzinfo (0.3.31)
118
+ tzinfo (0.3.32)
119
119
  xpath (0.1.4)
120
120
  nokogiri (~> 1.3)
121
121
 
@@ -124,10 +124,10 @@ PLATFORMS
124
124
 
125
125
  DEPENDENCIES
126
126
  bson_ext
127
- capybara (>= 1.1.1)
127
+ capybara
128
128
  colorific
129
129
  factory_girl_rails
130
130
  ffaker
131
131
  publish!
132
- rails (= 3.0.11)
132
+ rails (= 3.0.12)
133
133
  simplecov
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Publish
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -12,29 +12,24 @@ module Mongoid
12
12
  before_save :set_published_at
13
13
  end
14
14
 
15
- module InstanceMethods
16
- def published?
17
- if self.published && self.published_at && self.published_at <= Date.today
18
- true
19
- else
20
- false
21
- end
22
- end
15
+ def published?
16
+ return true if self.published && self.published_at && self.published_at <= Date.today
17
+ false
18
+ end
23
19
 
24
- def publish!
25
- self.published = true
26
- self.published_at = Date.today
27
- self.save
28
- end
29
-
30
- def publication_status
31
- self.published? ? self.published_at : "draft"
32
- end
20
+ def publish!
21
+ self.published = true
22
+ self.published_at = Date.today
23
+ self.save
24
+ end
25
+
26
+ def publication_status
27
+ self.published? ? self.published_at : "draft"
28
+ end
33
29
 
34
- private
35
- def set_published_at
36
- self.published_at = Date.today if self.published && self.published_at.nil?
37
- end
30
+ private
31
+ def set_published_at
32
+ self.published_at = Date.today if self.published && self.published_at.nil?
38
33
  end
39
34
 
40
35
  module ClassMethods
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-12-06 00:00:00.000000000 Z
13
+ date: 2012-03-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mongoid
17
- requirement: &2153290400 !ruby/object:Gem::Requirement
17
+ requirement: &2155892340 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '2.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2153290400
25
+ version_requirements: *2155892340
26
26
  description: Adds the functionality to publish/unpublish
27
27
  email:
28
28
  - contato@lucasrenan.com
@@ -32,6 +32,7 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - .gitignore
35
+ - .travis.yml
35
36
  - Gemfile
36
37
  - Gemfile.lock
37
38
  - MIT-LICENSE
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  version: '0'
107
108
  requirements: []
108
109
  rubyforge_project: publish
109
- rubygems_version: 1.8.12
110
+ rubygems_version: 1.8.16
110
111
  signing_key:
111
112
  specification_version: 3
112
113
  summary: Adds the functionality to publish/unpublish