technologist 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -3
- data/lib/technologist/framework_detector.rb +15 -10
- data/lib/technologist/repository.rb +4 -0
- data/lib/technologist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bbc961282d2862ad3488cdf378e6d9b19b90cd3
|
4
|
+
data.tar.gz: 52243c0f99f97473f80e6b49d5f468bdd990ce19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e58a914c663a8104a3477ab5022896e53f552158c774638d06dfcee38493e8cdab531ae9beb75850c839cf1457b7d609ca697f2ff846be7a7c8f80396af8db9e
|
7
|
+
data.tar.gz: 232121c7c70e681fc83b2add66a60924b184873d1aaed57bc26bc29a713b49c987f7b5ad5b58851e1b9bc675028fe3ff350e2422af93413c4a1e7943321d5ff1
|
data/README.md
CHANGED
@@ -26,8 +26,9 @@ Or install it yourself as:
|
|
26
26
|
require 'technologist'
|
27
27
|
|
28
28
|
technologist = Technologist::Repository.new('.')
|
29
|
-
technologist.primary_frameworks # => ['
|
30
|
-
technologist.secondary_frameworks # => ['
|
29
|
+
technologist.primary_frameworks # => ['Sinatra']
|
30
|
+
technologist.secondary_frameworks # => ['Dashing']
|
31
|
+
technologist.frameworks # => ['Sinatra', 'Dashing']
|
31
32
|
```
|
32
33
|
|
33
34
|
## Development
|
@@ -42,7 +43,7 @@ To add a framework definition add a new section to the
|
|
42
43
|
[frameworks.yml](lib/technologist/frameworks.yml) file and
|
43
44
|
add a new spec covering the new framework in [spec/frameworks_rules_spec.rb](spec/frameworks_rules_spec.rb)
|
44
45
|
|
45
|
-
1. Fork it ( https://github.com/
|
46
|
+
1. Fork it ( https://github.com/koffeinfrei/technologist/fork )
|
46
47
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
47
48
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
48
49
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -11,18 +11,24 @@ module Technologist
|
|
11
11
|
@yaml_parser = YamlParser.new(FRAMEWORK_RULES)
|
12
12
|
end
|
13
13
|
|
14
|
+
def frameworks
|
15
|
+
matched_frameworks.flat_map do |technology, definition|
|
16
|
+
[definition['primary'], technology]
|
17
|
+
end.compact.uniq
|
18
|
+
end
|
19
|
+
|
14
20
|
def primary_frameworks
|
15
|
-
matched_frameworks.map do |technology|
|
21
|
+
matched_frameworks.map do |technology, definition|
|
16
22
|
# it's either the primary value defined in the yaml
|
17
23
|
# or the technology itself
|
18
|
-
|
24
|
+
definition['primary'] || technology
|
19
25
|
end.uniq
|
20
26
|
end
|
21
27
|
|
22
28
|
def secondary_frameworks
|
23
|
-
matched_frameworks.map do |technology|
|
29
|
+
matched_frameworks.map do |technology, definition|
|
24
30
|
# it's a secondary if a primary is defined in the yaml
|
25
|
-
|
31
|
+
definition['primary'] && technology
|
26
32
|
end.compact
|
27
33
|
end
|
28
34
|
|
@@ -31,13 +37,12 @@ module Technologist
|
|
31
37
|
def matched_frameworks
|
32
38
|
@frameworks ||=
|
33
39
|
begin
|
34
|
-
yaml_parser.rules.
|
35
|
-
definition['rules'].
|
36
|
-
|
37
|
-
technology
|
38
|
-
end
|
40
|
+
matched_rules = yaml_parser.rules.select do |technology, definition|
|
41
|
+
definition['rules'].any? do |rule|
|
42
|
+
rule.matches?(repository)
|
39
43
|
end
|
40
|
-
end
|
44
|
+
end
|
45
|
+
Hash[matched_rules]
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
data/lib/technologist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: technologist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Reigel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|