scout-helpers 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/scout-helpers/version.rb +1 -1
- data/lib/scout-helpers.rb +18 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
Nzg5ZjY2MjhhYWIxOGEzNDM0ODNiZmU5Mjg3MGM5NzMzMTRkMDk5NA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MmZkY2Y2MGQ3M2Y4Zjk1Yjc2NmQyNjJkYmFhZDgyN2IwMWFjYzIzNQ==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
NjYxOGI3YTI0NGIwODk3ZTBjNDVkZGU3MTgzOTU5MTJlNDg4NjM1OGJhYTQz
|
|
10
|
+
OWNhYjc4ZDUzZGEyNTEyNTI1NzgzYzk5ZDM1YTE1YmE3ODg3ODdjMTViMDFl
|
|
11
|
+
ZDA3MmRkODNlMjA1M2UxZDY4MDEwMjgxMGI0MGRkYTdjMWZlMmM=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
OTUyNWQwZTA3YzA1MTY5MWM5MTE5ZDIxZmRiNTBiMDAwZWY1NWU5ZWNlMDZm
|
|
14
|
+
ZDJhY2Y3ZTc0ZGY4ZTIzZGQ3ZjIwYTYwODhjZDkwMTA3MmQzZjZkMTRlOGJi
|
|
15
|
+
Y2JkYTAyNThkNTQ4MjlhMmM2ZjFkODFkMDBkNzdkYWFkZDQ0MWU=
|
data/lib/scout-helpers.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require "scout-helpers/version"
|
|
2
2
|
|
|
3
3
|
module ScoutHelpers
|
|
4
|
-
# returns file for a category
|
|
4
|
+
# returns current file for a category
|
|
5
5
|
#
|
|
6
|
-
def self.
|
|
6
|
+
def self.get_current_file(path, category)
|
|
7
7
|
path = path.slice(0, path.size - 1) if path.end_with?('/')
|
|
8
8
|
File.new(
|
|
9
9
|
"#{path}/#{category}/" +
|
|
@@ -11,6 +11,21 @@ module ScoutHelpers
|
|
|
11
11
|
.select {|item| item.match(category)}
|
|
12
12
|
.reject {|item| item.match("#{category}_current")}
|
|
13
13
|
.sort
|
|
14
|
-
.last
|
|
14
|
+
.last
|
|
15
|
+
)
|
|
15
16
|
end
|
|
17
|
+
|
|
18
|
+
# returns last complete file for a category
|
|
19
|
+
#
|
|
20
|
+
def self.get_last_file(path, category)
|
|
21
|
+
path = path.slice(0, path.size - 1) if path.end_with?('/')
|
|
22
|
+
File.new(
|
|
23
|
+
"#{path}/#{category}/" +
|
|
24
|
+
Dir.entries("#{path}/#{category}")
|
|
25
|
+
.select {|item| item.match(category)}
|
|
26
|
+
.reject {|item| item.match("#{category}_current")}
|
|
27
|
+
.sort
|
|
28
|
+
.last(2)
|
|
29
|
+
.first
|
|
30
|
+
)
|
|
16
31
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scout-helpers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tucker Joseph
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-09-
|
|
11
|
+
date: 2013-09-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|