sheldon 0.2.7 → 0.3.0

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: 3a362c2944967c5547fc8852394c16806721dd0a
4
- data.tar.gz: 5b0c19f8e27bd0e339b799ff674a6ac8654bfe6f
3
+ metadata.gz: 5b89027c2b9ed6b6279afac46478daeb80519575
4
+ data.tar.gz: c28cc8c9b82878fe51dce0f307d30c2e0c9c879d
5
5
  SHA512:
6
- metadata.gz: 3c1fdec9e95e9bd92b3ff7713020a2ac529d4de9e94dab5d80de14d4cc7af23366c09e8b2b08a4d19cae55f2b16c76f2f86584fcce2a4c11e9fb4a3ef3dd5261
7
- data.tar.gz: 3144792bd5606157f305e4be30465c8712b390c1f4023e1e44602c1fb93783a84457d220fa559303158ebb74c973d441c9dcb2c983dfa23813562ad2f52dbd77
6
+ metadata.gz: a405d489433c81ca4fb4a99c0319cd1c6fa19a31d05106183ea2c13535258d828b64c15b76ac1335d990e7186c6778f629d87fa766b158cb49787540d9fcb151
7
+ data.tar.gz: 4195d7653dedbaaaf78a365954372009a06834b2217abeb33fcd784f519f769bbaeea62f8f53de55f85029bd4030c717116132d7ede5e62180b422ee232af362
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Sheldon
2
2
  [![Build Status](https://travis-ci.org/dvjones89/sheldon.svg?branch=master)](https://travis-ci.org/dvjones89/sheldon)
3
+ [![Coverage Status](https://coveralls.io/repos/github/dvjones89/sheldon/badge.svg?branch=master)](https://coveralls.io/github/dvjones89/sheldon?branch=master)
3
4
  [![Gem Version](https://badge.fury.io/rb/sheldon.svg)](https://badge.fury.io/rb/sheldon)
4
5
 
5
-
6
6
  Designed with the obsessive developer in mind, Sheldon makes it easy for you to manage your .dotfiles and configs across all your OS X / linux devices.
7
7
 
8
8
  ### Installation:
@@ -21,6 +21,7 @@ module CLI
21
21
  abs_learn_path = File.expand_path(rel_path_to_target)
22
22
  recall_cue = prompt_user("Recall Cue For File/Folder")
23
23
  sheldon.learn(recall_cue, abs_learn_path)
24
+ sheldon.recall(recall_cue)
24
25
  end
25
26
 
26
27
  desc "recall recall_cue", "Symlink a previously learnt file/directory to it's original location on the filesystem.\nUse `sheldon list` for available cues."
@@ -42,7 +43,9 @@ module CLI
42
43
 
43
44
  desc "list", "List all recall cues known by Sheldon"
44
45
  def list
45
- puts sheldon.list_cues
46
+ sheldon.list_cues.each do |recall_cue|
47
+ sheldon.recalled?(recall_cue) ? green(recall_cue) : red(recall_cue)
48
+ end
46
49
  end
47
50
 
48
51
  desc "version", "Prints the current version of Sheldon"
@@ -52,14 +55,22 @@ module CLI
52
55
 
53
56
  private
54
57
 
58
+ def announce(message)
59
+ logo = "💥".encode("utf-8")
60
+ puts logo + " Sheldon" + logo + " #{message}"
61
+ end
62
+
63
+ def green(message)
64
+ puts "\e[32m#{message}\e[0m"
65
+ end
66
+
55
67
  def prompt_user(prompt)
56
68
  print(prompt + ": ")
57
69
  STDIN.gets.chomp
58
70
  end
59
71
 
60
- def announce(message)
61
- logo = "💥".encode("utf-8")
62
- puts logo + " Sheldon" + logo + " #{message}"
72
+ def red(message)
73
+ puts "\e[31m#{message}\e[0m"
63
74
  end
64
75
 
65
76
  def sheldon
@@ -25,6 +25,13 @@ class Brain
25
25
  FileUtils.ln_s(read_cell(source_cell), destination_path, force: true)
26
26
  end
27
27
 
28
+ def recalled?(recall_cue)
29
+ entry = memory.recall(recall_cue)
30
+ destination_path = add_home(entry[:filepath])
31
+ destination_dir = File.dirname(destination_path)
32
+ File.symlink?(destination_path)
33
+ end
34
+
28
35
  def has_cue?(recall_cue)
29
36
  memory.has_cue?(recall_cue)
30
37
  end
@@ -1,7 +1,7 @@
1
1
  require "fileutils"
2
2
 
3
3
  class Sheldon
4
- VERSION = "0.2.7".freeze
4
+ VERSION = "0.3.0".freeze
5
5
  attr_reader :brain, :builder
6
6
 
7
7
  def initialize(sheldon_data_dir, opts = {})
@@ -19,7 +19,6 @@ class Sheldon
19
19
  raise "This cue has already been used."
20
20
  else
21
21
  brain.learn(recall_cue, abs_learn_path)
22
- brain.recall(recall_cue)
23
22
  end
24
23
  end
25
24
 
@@ -27,6 +26,11 @@ class Sheldon
27
26
  brain.list_cues
28
27
  end
29
28
 
29
+ def recalled?(recall_cue)
30
+ raise "Cue '#{recall_cue}' could not be found." unless brain.has_cue?(recall_cue)
31
+ brain.recalled?(recall_cue)
32
+ end
33
+
30
34
  def recall(recall_cue)
31
35
  raise "Cue '#{recall_cue}' could not be found." unless brain.has_cue?(recall_cue)
32
36
  brain.recall(recall_cue)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sheldon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Jones
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-20 00:00:00.000000000 Z
11
+ date: 2016-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -53,19 +53,39 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.3'
55
55
  - !ruby/object:Gem::Dependency
56
- name: simplecov
56
+ name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.10'
61
+ version: 0.8.13
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.10'
68
+ version: 0.8.13
69
+ - !ruby/object:Gem::Dependency
70
+ name: byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '9.0'
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 9.0.0
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '9.0'
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 9.0.0
69
89
  description: Another config and dotfile manager for unix environments
70
90
  email: david@dvj.me.uk
71
91
  executables: