anticuado 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/anticuado.rb +2 -0
- data/lib/anticuado/javascript/npm.rb +41 -0
- data/lib/anticuado/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 103a1513e6d917e01f8c7a9158fd60f7b5173244
|
4
|
+
data.tar.gz: b5b11cc176a246173a98d94efa62e730a79c0dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccc11cceb0bc15d5e1518e82430554e9d7bd7abc37f9b82d9697d4564df8185395acaef573e122c04baf95f18215d652c9fa642d92b2a766ccaf476fa1ea4511
|
7
|
+
data.tar.gz: e7a9356e011fe310149ccb328aa15f0e811f3aaa018c703247c4f667435ea1ef8d8b8e2ad92cf96e493b02b42127e34fac193a3800d20900fd1765831901b644
|
data/README.md
CHANGED
data/lib/anticuado.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
module Anticuado
|
2
|
+
module JavaScript
|
3
|
+
module Npm
|
4
|
+
# @param [String] project Path to project directory.
|
5
|
+
# @return [String] The result of command `npm outdated`.
|
6
|
+
def self.outdated(project: nil)
|
7
|
+
return puts "have no npm command" if `which npm`.empty?
|
8
|
+
|
9
|
+
if project
|
10
|
+
current_dir = Dir.pwd
|
11
|
+
Dir.chdir project
|
12
|
+
outdated_str = `npm outdated`
|
13
|
+
Dir.chdir current_dir
|
14
|
+
else
|
15
|
+
outdated_str = `npm outdated`
|
16
|
+
end
|
17
|
+
outdated_str
|
18
|
+
end
|
19
|
+
|
20
|
+
# @param [String] outdated The result of command `npm outdated`
|
21
|
+
# @return [Array] Array include outdated data.
|
22
|
+
# If target project have no outdated data, then return blank array such as `[]`
|
23
|
+
def self.format(outdated)
|
24
|
+
array = outdated.split(/\R/).map(&:strip)
|
25
|
+
index = array.find_index("Package Current Wanted Latest Location")
|
26
|
+
|
27
|
+
return [] if index.nil?
|
28
|
+
|
29
|
+
array[index + 1..array.size].map do |library|
|
30
|
+
versions = library.split(/\s+/) # e.g. ["babel-brunch", "6.0.2", "6.0.6", "6.0.6"]
|
31
|
+
{
|
32
|
+
library_name: versions[0],
|
33
|
+
current_version: versions[1],
|
34
|
+
available_version: versions[2],
|
35
|
+
latest_version: versions[3]
|
36
|
+
}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end # module Carthage
|
40
|
+
end # module IOS
|
41
|
+
end # module Anticuado
|
data/lib/anticuado/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anticuado
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- lib/anticuado/ios/carthage.rb
|
75
75
|
- lib/anticuado/ios/cocoapods.rb
|
76
76
|
- lib/anticuado/java/gradle.rb
|
77
|
+
- lib/anticuado/javascript/npm.rb
|
77
78
|
- lib/anticuado/ruby/bundler.rb
|
78
79
|
- lib/anticuado/version.rb
|
79
80
|
homepage: https://github.com/KazuCocoa/anticuado
|