diggit 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4b7487548c7f0524510efe878c636c54b58c304
4
- data.tar.gz: 481b02f7281fa616641b4106a36baa3f3a4b6b6c
3
+ metadata.gz: 5edef2423b0ffdd802d4c7f78b60fbf466878577
4
+ data.tar.gz: fd9005d6f5acc9f4f0fc4f84677ed87bff59dddd
5
5
  SHA512:
6
- metadata.gz: 1a6c92ce2456aff993a743a14a8f71752fdf0f27fae13dafb2e7f58ec1f53795c53381f883b0ce3478380d10799888ef5de5c3908a856bf401a9a27e1fb18280
7
- data.tar.gz: bc12d9e29df011d9675fae2392aeee0282ac9cd3571a1e7f216f3545e29a74c55dbc846f9ddc7caf0afb41802333b6d4c632f93847eee3c096f900b6beeaf29f
6
+ metadata.gz: 900953e9d6b740ffcce9d600b8935a70d23d5a91c81156db6820581460e880c897158e37202ac7da6a555aa0e0f9237c7f54bd0599471af423292894a4e3e343
7
+ data.tar.gz: 05cbb988a51d483787f68155f296693b080c7c5c285390401b369260cd1c366d254eaf2783d27ce2c484d190196da2587f756647fc2d1f479481f88dc03673c6
data/lib/diggit_cli.rb CHANGED
@@ -32,7 +32,7 @@ module Diggit
32
32
  end
33
33
 
34
34
  def status_color(status)
35
- if status == DONE
35
+ if status == Cli::DONE
36
36
  return :green
37
37
  else
38
38
  return :red
@@ -59,7 +59,7 @@ module Diggit
59
59
  say_status("[#{s[:log][:state]}]", "#{idx}: #{s[:url]}", source_color(s))
60
60
  idx += 1
61
61
  end
62
- errors = diggit.sources.errors.size
62
+ errors = diggit.sources.get_all(nil, {error: true}).size
63
63
  status = (errors== 0 && DONE) || ERROR
64
64
  say_status(status, "listed #{diggit.sources.size} sources including #{errors} errors", status_color(status))
65
65
  end
@@ -259,11 +259,13 @@ module Diggit
259
259
  def initialize(*args)
260
260
  super
261
261
  cmd = args[2][:current_command].name
262
- unless 'init'.eql?(cmd) || 'help'.eql?(cmd) || File.exist?(DIGGIT_RC)
263
- say_status(ERROR, "this is not a diggit directory", :red)
264
- exit
262
+ unless 'init'.eql?(cmd) || 'help'.eql?(cmd)
263
+ unless File.exist?(DIGGIT_RC)
264
+ say_status(ERROR, "this is not a diggit directory", :red)
265
+ else
266
+ diggit
267
+ end
265
268
  end
266
- diggit
267
269
  end
268
270
 
269
271
  desc "init", "Initialize the current folder as a diggit folder."
data/lib/diggit_core.rb CHANGED
@@ -13,6 +13,7 @@ module Diggit
13
13
 
14
14
  SOURCES_FOLDER = 'sources'
15
15
  INCLUDES_FOLDER = 'includes'
16
+ DIGGIT_FOLDER = ".diggit"
16
17
 
17
18
  class Addon
18
19
 
@@ -264,8 +265,14 @@ module Diggit
264
265
  end
265
266
 
266
267
  def load_plugins
267
- globals = File.expand_path(INCLUDES_FOLDER,File.expand_path('..',File.dirname(File.realpath(__FILE__))))
268
- Dir.glob("#{globals}/**/*.rb").each{ |f| require f }
268
+ global = File.expand_path(INCLUDES_FOLDER,File.expand_path('..',File.dirname(File.realpath(__FILE__))))
269
+ Dir["#{global}/**/*.rb"].each{ |f| require f }
270
+
271
+ home = File.expand_path(INCLUDES_FOLDER,File.expand_path(DIGGIT_FOLDER,Dir.home))
272
+ Dir["#{home}/**/*.rb"].each{ |f| require f }
273
+
274
+ local = File.expand_path(INCLUDES_FOLDER)
275
+ Dir["#{local}/**/*.rb"].each{ |f| require f }
269
276
  end
270
277
 
271
278
  end
data/spec/diggit_spec.rb CHANGED
@@ -30,6 +30,12 @@ RSpec.describe Diggit::Cli::DiggitCli do
30
30
  expect(sources).to include(WRONG_URL)
31
31
  end
32
32
 
33
+ it "should list the sources" do
34
+ result = capture(:stdout) { Diggit::Cli::DiggitCli.start(["sources", "list"]) }
35
+ expect(result).to include(TEST_URL)
36
+ expect(result).to include(WRONG_URL)
37
+ end
38
+
33
39
  it "should display the status" do
34
40
  result = capture(:stdout) { Diggit::Cli::DiggitCli.start(["status"]) }
35
41
  expect(result).to include("2 new (0 errors)")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diggit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Rémy Falleri
@@ -118,3 +118,4 @@ signing_key:
118
118
  specification_version: 4
119
119
  summary: A Git repository analysis tool.
120
120
  test_files: []
121
+ has_rdoc: