deka 0.0.1 → 0.0.2

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: ac4d091e219f45f44290ef7e48a6781a9c8dc868
4
- data.tar.gz: bc5e5b5a3172901bf9d554b76ee1ec31c1caa561
3
+ metadata.gz: 2c173d10f74c99df0bcf63dce853ad58a285bcab
4
+ data.tar.gz: 7179e40b8bafa541572d92068f1e0856f150fbd5
5
5
  SHA512:
6
- metadata.gz: 03d1fe989ec67e09cfc746247fa6a723c78a840de8a7c9fb61dcb792260f0f10550f16690bae5974a5543b15e379efaf58062e0b04c1ba13d05d3b5ce0992ce9
7
- data.tar.gz: 4155b9367d4445f27952eb52ac5a38dc9b861ff37b3640ce66bf3a35a23cac7d040f8d9426352aceac2651442f61012eb2b0f42a6064e550f36e378dd6f92eeb
6
+ metadata.gz: da5e55d82b80892ac8242c3e7eae133cef823b21890753f7cc88851dceae1d57e66a84d3d0ea6dfa5b9f8141c2a143ee3b8da93e7893468003eb6f8b69577949
7
+ data.tar.gz: 1ffc02b4c65174051194dd8856accaeea30866310db678cba83c459974de19ec895ba279eaf72e28ded7bee125e37689520f073c0478225619ed467fbf442dad
data/lib/deka/cli.rb CHANGED
@@ -12,7 +12,7 @@ class Deka::Cli
12
12
  def initialize(options = {})
13
13
  @config = options[:config] || './deka.yml'
14
14
  @save_file = options[:save] || './.tracked_hash'
15
- @base_hash = File.read(save_file).chomp
15
+ @base_hash = File.exists?(save_file) && File.read(save_file).chomp
16
16
  @dry_run = options[:'dry-run']
17
17
  end
18
18
 
@@ -38,6 +38,13 @@ class Deka::Cli
38
38
  private
39
39
 
40
40
  def yaml
41
+ return @yaml if @yaml
42
+
43
+ unless File.exists?(config)
44
+ puts "You don't have config file(default './deka.yml')"
45
+ exit 1
46
+ end
47
+
41
48
  @yaml = YAML.load(File.read(config))
42
49
  end
43
50
 
data/lib/deka/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Deka
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -3,8 +3,8 @@ require 'spec_helper'
3
3
  describe Deka::Cli do
4
4
  describe '#run' do
5
5
  context 'when pass config and save_file as argument' do
6
- let(:config) { File.expand_path('../support/sample.yml', __FILE__) }
7
- let(:save_file) { File.expand_path('../support/.tracked_hash', __FILE__) }
6
+ let(:config) { './spec/support/sample.yml' }
7
+ let(:save_file) { './spec/support/.tracked_hash' }
8
8
  let!(:old_hash_txt) { File.read(save_file) }
9
9
 
10
10
  after do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - willnet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-25 00:00:00.000000000 Z
11
+ date: 2014-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit