anticuado 0.2.4 → 0.2.5

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: 100e8f2621ae014077cadc7dd777e05027fccd48
4
- data.tar.gz: c6f53ddd1e7ab1380611c2fb9d89812ec51d778d
3
+ metadata.gz: 69c670cc3fd5482db3af2366713bcc4147e38eef
4
+ data.tar.gz: 038d5fff7ce3822add7cf0d7af0d2e64f680dfdd
5
5
  SHA512:
6
- metadata.gz: 3632fc0b7de82cf19b38f0465a14931336caa082d57ff6d5b88aad740f8942d9f894cf4be32677da27c0f69c05ba4563ad6f8a4d1a4e7c9bfd925dab8d9207c0
7
- data.tar.gz: 18cb2e499c481dad4295f648f58d91a5a1802434fc3879c8adf3a067ccac825602d45cc7d734681c31ac3d6afa2f82163918ec56da590209f37f691ba7887f5e
6
+ metadata.gz: 6d3798b249500edd11c4b388c4cd60fb240bbe7ed751ecfcfd233859b0f8a521d8a5d92854859e258c1757c245f520bf913fb91d4fb50f4013dcae4bb9682681
7
+ data.tar.gz: 60138b9362d363bcee1f997ac60f8beca106641005f7b81f48dae32a657ff2bb75f602b5d75256e38abf581b2391f1751f6903bb95e5a2ce0c46cea6273843a0
@@ -10,6 +10,7 @@ require "anticuado/elixir/hex"
10
10
  require "anticuado/ruby/bundler"
11
11
 
12
12
  require "anticuado/javascript/npm"
13
+ require "anticuado/javascript/yarn"
13
14
 
14
15
  module Anticuado
15
16
  def self.current_dir
@@ -2,7 +2,7 @@ require "json"
2
2
 
3
3
  module Anticuado
4
4
  module Java
5
- class Gradle
5
+ module Gradle
6
6
  # require: https://github.com/ben-manes/gradle-versions-plugin
7
7
  # @param [String] revision "release", "milestone" or "integration". Default is "release".
8
8
  # @param [Bool] wrapper Use gradle wrapper or use gradle directory.
@@ -27,7 +27,7 @@ module Anticuado
27
27
 
28
28
  return [] if index.nil?
29
29
 
30
- array[index + 1..array.size].map do |library|
30
+ array[index + 1...array.size].map do |library|
31
31
  versions = library.split(/\s+/) # e.g. ["babel-brunch", "6.0.2", "6.0.6", "6.0.6"]
32
32
  {
33
33
  library_name: versions[0],
@@ -37,6 +37,6 @@ module Anticuado
37
37
  }
38
38
  end
39
39
  end
40
- end # module Carthage
41
- end # module IOS
40
+ end # module Npm
41
+ end # module JavaScript
42
42
  end # module Anticuado
@@ -0,0 +1,42 @@
1
+ module Anticuado
2
+ module JavaScript
3
+ module Yarn
4
+ # @param [String] project Path to project directory.
5
+ # @return [String] The result of command `yarn outdated`.
6
+ def self.outdated(project = nil)
7
+ return puts "have no yarn command" if `which yarn`.empty?
8
+
9
+ if project
10
+ current_dir = Anticuado.current_dir
11
+ Dir.chdir Anticuado.project_dir(project)
12
+ `yarn install`
13
+ outdated_str = `yarn outdated`
14
+ Dir.chdir current_dir
15
+ else
16
+ outdated_str = `yarn outdated`
17
+ end
18
+ outdated_str
19
+ end
20
+
21
+ # @param [String] outdated The result of command `yarn outdated`
22
+ # @return [Array] Array include outdated data.
23
+ # If target project have no outdated data, then return blank array such as `[]`
24
+ def self.format(outdated)
25
+ array = outdated.split(/\R/).map(&:strip)
26
+ index = array.find_index { |line| line.scan(/Package\s+Current\s+Wanted\s+Latest/) != [] }
27
+
28
+ return [] if index.nil?
29
+
30
+ array[index + 1...(array.size - 1)].map do |library|
31
+ versions = library.split(/\s+/) # e.g. ["babel-brunch", "6.0.2", "6.0.6", "6.0.6"]
32
+ {
33
+ library_name: versions[0],
34
+ current_version: versions[1],
35
+ available_version: versions[2],
36
+ latest_version: versions[3]
37
+ }
38
+ end
39
+ end
40
+ end # module Yarn
41
+ end # module JavaScript
42
+ end # module Anticuado
@@ -1,3 +1,3 @@
1
1
  module Anticuado
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
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.2.4
4
+ version: 0.2.5
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-09 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,6 +75,7 @@ files:
75
75
  - lib/anticuado/ios/cocoapods.rb
76
76
  - lib/anticuado/java/gradle.rb
77
77
  - lib/anticuado/javascript/npm.rb
78
+ - lib/anticuado/javascript/yarn.rb
78
79
  - lib/anticuado/ruby/bundler.rb
79
80
  - lib/anticuado/version.rb
80
81
  homepage: https://github.com/KazuCocoa/anticuado