optimacms 0.1.56 → 0.1.57
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3d4e52c4c4f6ee80e2e2cc715fe5942ee76800f
|
4
|
+
data.tar.gz: ab6c741215c43f9a2ab6da485b835a7c4bfdd765
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14df3169bf11dab1293192bae129fb27a2fb7e581f22b355038f3f68c9a03ab134ea80a22da4dcca5f50b99aa9ddcf2882c4fc7920e6ecc0edf85aff2d2d938c
|
7
|
+
data.tar.gz: 512efcbef77513ee9d20b0281842a0d71280171dfed7265470f12925435c059ef48ec5b5a72c8954d5b59ee75e7e0f1347ecb8d1b58fbe609e48407eb2ed59a8
|
@@ -24,13 +24,38 @@ module Optimacms
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def addadminuser
|
27
|
-
return
|
27
|
+
#return
|
28
28
|
|
29
|
-
row = Optimacms::CmsAdminUser.new
|
29
|
+
row = Optimacms::CmsAdminUser.where(email: 'admin@example.com').first || Optimacms::CmsAdminUser.new
|
30
30
|
row.email = 'admin@example.com'
|
31
31
|
row.password = 'password'
|
32
|
+
row.password_confirmation = row.password
|
32
33
|
|
33
|
-
row.save
|
34
|
+
row.save!
|
35
|
+
end
|
36
|
+
|
37
|
+
def url1
|
38
|
+
v = '[a-z\d\_]+'
|
39
|
+
|
40
|
+
p = '(:pg)'
|
41
|
+
p.gsub! /(\(\:#{v}\))([-\.]|$)/, '([^/]+|)\2'
|
42
|
+
|
43
|
+
x = 0
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
def url2
|
48
|
+
u = "news/3"
|
49
|
+
r = /^news\/([^\/]+|)$/
|
50
|
+
|
51
|
+
if u =~ /^news(\/.*|)$/
|
52
|
+
|
53
|
+
x = $1
|
54
|
+
y = $2
|
55
|
+
|
56
|
+
z=0
|
57
|
+
|
58
|
+
end
|
34
59
|
end
|
35
60
|
end
|
36
61
|
|
@@ -63,7 +63,11 @@ module Optimacms
|
|
63
63
|
|
64
64
|
url_parts = url.split '/'
|
65
65
|
a = []
|
66
|
+
i_part = 0
|
66
67
|
url_parts.each do |part|
|
68
|
+
i_part+=1
|
69
|
+
|
70
|
+
|
67
71
|
# check for brackets inside brackets
|
68
72
|
return nil if part =~ /\{[^{}]*[{}][^{}]*\}/
|
69
73
|
|
@@ -72,9 +76,20 @@ module Optimacms
|
|
72
76
|
|
73
77
|
p = part
|
74
78
|
|
79
|
+
|
80
|
+
# variables inside (.) - optional
|
81
|
+
|
82
|
+
if i_part>1
|
83
|
+
# add / to the beginning - / is optional too
|
84
|
+
p.gsub! /(\(\:#{REGEX_VARIABLE}\))([-\.]|$)/, '(\/[^/]+)*\2'
|
85
|
+
else
|
86
|
+
# the first param
|
87
|
+
p.gsub! /(\(\:#{REGEX_VARIABLE}\))([-\.]|$)/, '([^/]+)*\2'
|
88
|
+
end
|
89
|
+
|
75
90
|
# variables
|
76
91
|
#p.gsub! /\{\$[^}]+\}/, '([^/]+)'
|
77
|
-
p.gsub! /(\:#{REGEX_VARIABLE})([-\.]|$)/, '([^/]+)\2'
|
92
|
+
p.gsub! /(\:#{REGEX_VARIABLE})([-\.]|$)/, '\/([^/]+)\2'
|
78
93
|
|
79
94
|
|
80
95
|
# escape system symbols
|
@@ -85,7 +100,7 @@ module Optimacms
|
|
85
100
|
a << p
|
86
101
|
end
|
87
102
|
|
88
|
-
return '^'+url_parts.join('
|
103
|
+
return '^'+url_parts.join('')+'$'
|
89
104
|
end
|
90
105
|
|
91
106
|
def self.count_url_parts(url)
|
@@ -173,4 +188,4 @@ module Optimacms
|
|
173
188
|
end
|
174
189
|
|
175
190
|
end
|
176
|
-
end
|
191
|
+
end
|
data/lib/optimacms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: optimacms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.57
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Ivak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|