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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b46de4e946ee943984f1f18e893384655ec590ff
4
- data.tar.gz: 6297c55801f2d3743cb5af3fbfb9776384781121
3
+ metadata.gz: 103a1513e6d917e01f8c7a9158fd60f7b5173244
4
+ data.tar.gz: b5b11cc176a246173a98d94efa62e730a79c0dca
5
5
  SHA512:
6
- metadata.gz: fc5753bbf188321202480e52db0709a9483fe6934aa2c45d8760b116aee8b46921ed8c6ed0d940b18c688f6e7a337da5629b10a1c53d2eafd82fd1ecaab151c2
7
- data.tar.gz: 9fcadeb142427baf21383e68ea6cf1b3d107c1da51fecf7b05ad9b8edb03e5668248950379db770fac1405d24e080667b273d1488e8f3f94faa50aaeb3695801
6
+ metadata.gz: ccc11cceb0bc15d5e1518e82430554e9d7bd7abc37f9b82d9697d4564df8185395acaef573e122c04baf95f18215d652c9fa642d92b2a766ccaf476fa1ea4511
7
+ data.tar.gz: e7a9356e011fe310149ccb328aa15f0e811f3aaa018c703247c4f667435ea1ef8d8b8e2ad92cf96e493b02b42127e34fac193a3800d20900fd1765831901b644
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Anticuado
2
2
 
3
- This library collect __outdated__ libraries for each platforms.
3
+ This library collect __outdated__ libraries for each platforms. [Here](https://github.com/KazuCocoa/anticuado-example) is example how to use this library.
4
4
 
5
5
  ## Support
6
6
  - Java
@@ -9,6 +9,8 @@ require "anticuado/elixir/hex"
9
9
 
10
10
  require "anticuado/ruby/bundler"
11
11
 
12
+ require "anticuado/javascript/npm"
13
+
12
14
  module Anticuado
13
15
  # Your code goes here...
14
16
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Anticuado
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-02 00:00:00.000000000 Z
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