ants 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fffa22182df15ae5af9a5ca27f826d94fec46d80
4
- data.tar.gz: b07f9d32a98b47487a812604db8120d8ee9d3fff
3
+ metadata.gz: 526170ecd0409a54b779d8cbcd86759f882d791b
4
+ data.tar.gz: 3945f710306052abb2a0767e8520c9888e9e1e9f
5
5
  SHA512:
6
- metadata.gz: 048355f393f3b41471c7349df8fff9c1db2f0cb6ae4327166e88d6de8230a5c57afbfd6fc1013e2f2a7e57292068e3bbcfff4403daa54710ddf5f9980b0dfd8a
7
- data.tar.gz: 3aab8fbaa685e40bbf840008844990ba025fa4328a7900444e8042d60e91da30a6c51929377f12255eeaecfbb75176666ce089d326e294a7bd6d21c7f20ced92
6
+ metadata.gz: 3e42a67719bdf9a0fac7049ae31e38bfcf5e489ece9801e9c91535d53ed323e058a861fe31f6fa1b0c14edc4abc0c61b33838fde49305dcb16081a9a9e122c9e
7
+ data.tar.gz: b2179156b2104f186c09813da2ba1c1c62ad76e30b1528b0b8092e0b57afef2c41b5ca35b817f7c021904daaaad8239ef7fe45fd51cacdb611502ee34cb5a90e
data/Gemfile.lock CHANGED
@@ -1,76 +1,85 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ants (0.2.0)
4
+ ants (0.2.1)
5
+ devise
5
6
  mongoid (>= 4.0)
6
7
  mongoid-slug (>= 4.0.0)
7
8
 
8
9
  GEM
9
10
  remote: http://rubygems.org/
10
11
  specs:
11
- actionmailer (4.2.1)
12
- actionpack (= 4.2.1)
13
- actionview (= 4.2.1)
14
- activejob (= 4.2.1)
12
+ actionmailer (4.2.4)
13
+ actionpack (= 4.2.4)
14
+ actionview (= 4.2.4)
15
+ activejob (= 4.2.4)
15
16
  mail (~> 2.5, >= 2.5.4)
16
17
  rails-dom-testing (~> 1.0, >= 1.0.5)
17
- actionpack (4.2.1)
18
- actionview (= 4.2.1)
19
- activesupport (= 4.2.1)
18
+ actionpack (4.2.4)
19
+ actionview (= 4.2.4)
20
+ activesupport (= 4.2.4)
20
21
  rack (~> 1.6)
21
22
  rack-test (~> 0.6.2)
22
23
  rails-dom-testing (~> 1.0, >= 1.0.5)
23
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
24
- actionview (4.2.1)
25
- activesupport (= 4.2.1)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
25
+ actionview (4.2.4)
26
+ activesupport (= 4.2.4)
26
27
  builder (~> 3.1)
27
28
  erubis (~> 2.7.0)
28
29
  rails-dom-testing (~> 1.0, >= 1.0.5)
29
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
30
- activejob (4.2.1)
31
- activesupport (= 4.2.1)
30
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
+ activejob (4.2.4)
32
+ activesupport (= 4.2.4)
32
33
  globalid (>= 0.3.0)
33
- activemodel (4.2.1)
34
- activesupport (= 4.2.1)
34
+ activemodel (4.2.4)
35
+ activesupport (= 4.2.4)
35
36
  builder (~> 3.1)
36
- activerecord (4.2.1)
37
- activemodel (= 4.2.1)
38
- activesupport (= 4.2.1)
37
+ activerecord (4.2.4)
38
+ activemodel (= 4.2.4)
39
+ activesupport (= 4.2.4)
39
40
  arel (~> 6.0)
40
- activesupport (4.2.1)
41
+ activesupport (4.2.4)
41
42
  i18n (~> 0.7)
42
43
  json (~> 1.7, >= 1.7.7)
43
44
  minitest (~> 5.1)
44
45
  thread_safe (~> 0.3, >= 0.3.4)
45
46
  tzinfo (~> 1.1)
46
- arel (6.0.0)
47
+ arel (6.0.3)
48
+ bcrypt (3.1.10)
47
49
  bson (3.2.4)
48
50
  builder (3.2.2)
49
51
  connection_pool (2.2.0)
50
- coveralls (0.8.1)
52
+ coveralls (0.8.2)
51
53
  json (~> 1.8)
52
54
  rest-client (>= 1.6.8, < 2)
53
55
  simplecov (~> 0.10.0)
54
56
  term-ansicolor (~> 1.3)
55
57
  thor (~> 0.19.1)
58
+ devise (3.5.2)
59
+ bcrypt (~> 3.0)
60
+ orm_adapter (~> 0.1)
61
+ railties (>= 3.2.6, < 5)
62
+ responders
63
+ thread_safe (~> 0.1)
64
+ warden (~> 1.2.3)
56
65
  diff-lcs (1.2.5)
57
66
  docile (1.1.5)
58
67
  domain_name (0.5.24)
59
68
  unf (>= 0.0.5, < 1.0.0)
60
69
  erubis (2.7.0)
61
- globalid (0.3.5)
70
+ globalid (0.3.6)
62
71
  activesupport (>= 4.1.0)
63
72
  http-cookie (1.0.2)
64
73
  domain_name (~> 0.5)
65
74
  i18n (0.7.0)
66
- json (1.8.2)
67
- loofah (2.0.1)
75
+ json (1.8.3)
76
+ loofah (2.0.3)
68
77
  nokogiri (>= 1.5.9)
69
78
  mail (2.6.3)
70
79
  mime-types (>= 1.16, < 3)
71
- mime-types (2.5)
80
+ mime-types (2.6.1)
72
81
  mini_portile (0.6.2)
73
- minitest (5.6.1)
82
+ minitest (5.8.0)
74
83
  mongoid (4.0.2)
75
84
  activemodel (~> 4.0)
76
85
  moped (~> 2.0.0)
@@ -88,74 +97,79 @@ GEM
88
97
  mini_portile (~> 0.6.0)
89
98
  optionable (0.2.0)
90
99
  origin (2.1.1)
91
- rack (1.6.0)
100
+ orm_adapter (0.5.0)
101
+ rack (1.6.4)
92
102
  rack-test (0.6.3)
93
103
  rack (>= 1.0)
94
- rails (4.2.1)
95
- actionmailer (= 4.2.1)
96
- actionpack (= 4.2.1)
97
- actionview (= 4.2.1)
98
- activejob (= 4.2.1)
99
- activemodel (= 4.2.1)
100
- activerecord (= 4.2.1)
101
- activesupport (= 4.2.1)
104
+ rails (4.2.4)
105
+ actionmailer (= 4.2.4)
106
+ actionpack (= 4.2.4)
107
+ actionview (= 4.2.4)
108
+ activejob (= 4.2.4)
109
+ activemodel (= 4.2.4)
110
+ activerecord (= 4.2.4)
111
+ activesupport (= 4.2.4)
102
112
  bundler (>= 1.3.0, < 2.0)
103
- railties (= 4.2.1)
113
+ railties (= 4.2.4)
104
114
  sprockets-rails
105
115
  rails-deprecated_sanitizer (1.0.3)
106
116
  activesupport (>= 4.2.0.alpha)
107
- rails-dom-testing (1.0.6)
117
+ rails-dom-testing (1.0.7)
108
118
  activesupport (>= 4.2.0.beta, < 5.0)
109
119
  nokogiri (~> 1.6.0)
110
120
  rails-deprecated_sanitizer (>= 1.0.1)
111
121
  rails-html-sanitizer (1.0.2)
112
122
  loofah (~> 2.0)
113
- railties (4.2.1)
114
- actionpack (= 4.2.1)
115
- activesupport (= 4.2.1)
123
+ railties (4.2.4)
124
+ actionpack (= 4.2.4)
125
+ activesupport (= 4.2.4)
116
126
  rake (>= 0.8.7)
117
127
  thor (>= 0.18.1, < 2.0)
118
128
  rake (10.4.2)
129
+ responders (2.1.0)
130
+ railties (>= 4.2.0, < 5)
119
131
  rest-client (1.8.0)
120
132
  http-cookie (>= 1.0.2, < 2.0)
121
133
  mime-types (>= 1.16, < 3.0)
122
134
  netrc (~> 0.7)
123
- rspec (3.2.0)
124
- rspec-core (~> 3.2.0)
125
- rspec-expectations (~> 3.2.0)
126
- rspec-mocks (~> 3.2.0)
135
+ rspec (3.3.0)
136
+ rspec-core (~> 3.3.0)
137
+ rspec-expectations (~> 3.3.0)
138
+ rspec-mocks (~> 3.3.0)
127
139
  rspec-aspic (0.0.2)
128
- rspec-core (3.2.3)
129
- rspec-support (~> 3.2.0)
130
- rspec-expectations (3.2.1)
140
+ rspec-core (3.3.2)
141
+ rspec-support (~> 3.3.0)
142
+ rspec-expectations (3.3.1)
131
143
  diff-lcs (>= 1.2.0, < 2.0)
132
- rspec-support (~> 3.2.0)
133
- rspec-mocks (3.2.1)
144
+ rspec-support (~> 3.3.0)
145
+ rspec-mocks (3.3.2)
134
146
  diff-lcs (>= 1.2.0, < 2.0)
135
- rspec-support (~> 3.2.0)
136
- rspec-support (3.2.2)
147
+ rspec-support (~> 3.3.0)
148
+ rspec-support (3.3.0)
137
149
  simplecov (0.10.0)
138
150
  docile (~> 1.1.0)
139
151
  json (~> 1.8)
140
152
  simplecov-html (~> 0.10.0)
141
153
  simplecov-html (0.10.0)
142
- sprockets (3.0.2)
154
+ sprockets (3.3.4)
143
155
  rack (~> 1.0)
144
- sprockets-rails (2.2.4)
156
+ sprockets-rails (2.3.2)
145
157
  actionpack (>= 3.0)
146
158
  activesupport (>= 3.0)
147
159
  sprockets (>= 2.8, < 4.0)
148
160
  stringex (2.5.2)
149
- term-ansicolor (1.3.0)
161
+ term-ansicolor (1.3.2)
150
162
  tins (~> 1.0)
151
163
  thor (0.19.1)
152
164
  thread_safe (0.3.5)
153
- tins (1.5.1)
165
+ tins (1.6.0)
154
166
  tzinfo (1.2.2)
155
167
  thread_safe (~> 0.1)
156
168
  unf (0.1.4)
157
169
  unf_ext
158
170
  unf_ext (0.0.7.1)
171
+ warden (1.2.3)
172
+ rack (>= 1.0)
159
173
 
160
174
  PLATFORMS
161
175
  ruby
data/ants.gemspec CHANGED
@@ -22,6 +22,7 @@ Collection of concerns and helpers for Rails + Mongoid + Character web developme
22
22
 
23
23
  s.add_dependency('mongoid', '>= 4.0' )
24
24
  s.add_dependency('mongoid-slug', '>= 4.0.0')
25
+ s.add_dependency('devise')
25
26
 
26
27
  s.add_development_dependency('rails', [ '>= 4.2' ])
27
28
  s.add_development_dependency('rspec', [ '>= 2.0' ])
@@ -30,5 +31,4 @@ Collection of concerns and helpers for Rails + Mongoid + Character web developme
30
31
 
31
32
  s.add_development_dependency('bundler', '~> 1.9')
32
33
  s.add_development_dependency('rake', '~> 10.0')
33
-
34
34
  end
@@ -0,0 +1,3 @@
1
+ class Admin::AdminsController < Admin::BaseController
2
+ mongosteen
3
+ end
@@ -0,0 +1,4 @@
1
+ class Admin::RedirectsController < Admin::BaseController
2
+ mongosteen
3
+ csv_config({ only: [ :old_path, :new_path ] })
4
+ end
data/app/models/admin.rb CHANGED
@@ -1,26 +1,17 @@
1
- # -------------------------------------------------------------------
2
- # Make sure /config/initializers/device.rb includes :email like:
3
- #
4
- # config.case_insensitive_keys = [ :email ]
5
- #
6
- # This is required to make it possible for users login with case
7
- # insensative emails.
8
- # -------------------------------------------------------------------
9
1
  class Admin
10
2
  include Mongoid::Document
11
3
  include Mongoid::Timestamps
12
-
13
4
  include Mongoid::Search
14
5
  include Ants::Id
15
6
 
16
-
17
7
  ## Attributes
18
8
  field :name
19
9
  field :permissions, type: Array
20
10
 
11
+
21
12
  # Include default devise modules. Others available are:
22
- # :confirmable, :lockable, :timeoutable, :registerable, :validatable and :omniauthable
23
- devise :database_authenticatable, :recoverable, :rememberable, :trackable, :authentication_keys => [ :email ]
13
+ # :confirmable, :lockable, :timeoutable, :registerable and :omniauthable
14
+ devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable
24
15
 
25
16
  ## Database authenticatable
26
17
  field :email, type: String, default: ""
@@ -40,21 +31,9 @@ class Admin
40
31
  field :current_sign_in_ip, type: String
41
32
  field :last_sign_in_ip, type: String
42
33
 
43
- ## Confirmable
44
- # field :confirmation_token, type: String
45
- # field :confirmed_at, type: Time
46
- # field :confirmation_sent_at, type: Time
47
- # field :unconfirmed_email, type: String # Only if using reconfirmable
48
-
49
- ## Lockable
50
- # field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
51
- # field :unlock_token, type: String # Only if unlock strategy is :email or :both
52
- # field :locked_at, type: Time
53
-
54
34
 
55
35
  ## Validations
56
36
  validates :name, presence: true
57
- validates :email, presence: true, allow_blank: false, uniqueness: true
58
37
 
59
38
 
60
39
  ## Search
@@ -75,15 +54,6 @@ class Admin
75
54
  end
76
55
 
77
56
 
78
- def last_sign_in_ago
79
- if last_sign_in_at
80
- 'Seen ' + ActionController::Base.helpers.time_ago_in_words(last_sign_in_at) + ' ago'
81
- else
82
- 'Never seen'
83
- end
84
- end
85
-
86
-
87
57
  def _list_item_title
88
58
  name.empty? ? email : name
89
59
  end
@@ -98,6 +68,17 @@ class Admin
98
68
  "http://www.gravatar.com/avatar/#{ Digest::MD5.hexdigest(email) }?s=80&d=retro&r=g"
99
69
  end
100
70
 
71
+
72
+ private
73
+
74
+ def last_sign_in_ago
75
+ if last_sign_in_at
76
+ 'Seen ' + ActionController::Base.helpers.time_ago_in_words(last_sign_in_at) + ' ago'
77
+ else
78
+ 'Never seen'
79
+ end
80
+ end
81
+
101
82
  end
102
83
 
103
84
 
@@ -1,7 +1,6 @@
1
1
  class Redirect
2
2
  include Mongoid::Document
3
3
  include Mongoid::Timestamps
4
-
5
4
  include Mongoid::Search
6
5
  include Ants::Id
7
6
 
data/lib/ants/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ants
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/ants.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'mongoid'
2
2
  require 'mongoid_slug'
3
+ require 'devise'
3
4
 
4
5
  module Ants
5
6
  require 'ants/engine'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ants
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kravets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 4.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: devise
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rails
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -144,6 +158,8 @@ files:
144
158
  - app/assets/javascripts/chr/redirects.coffee
145
159
  - app/assets/stylesheets/ants.scss
146
160
  - app/assets/stylesheets/chr/header.scss
161
+ - app/controllers/admin/admins_controller.rb
162
+ - app/controllers/admin/redirects_controller.rb
147
163
  - app/controllers/redirects_controller.rb
148
164
  - app/mailers/admin_mailer.rb
149
165
  - app/models/admin.rb