charter 0.0.13 → 0.0.14

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: 3e23c96fd443c26400992cf0930f7756e1b3f34b
4
- data.tar.gz: be42190dbc2d9361ca1ad54f3544b7d8a07c9cee
3
+ metadata.gz: 69983a0f6f77ea4820913ebe28822666098beb74
4
+ data.tar.gz: 313a90acdee29f9b211cbeacd289cda96533ba9a
5
5
  SHA512:
6
- metadata.gz: 9189941574fef7e36f602f70e7948e6821e87d6a7f984ed3e5c9903d2a15d25176a886d64a625853444235301dc018df961361ff4bdd6aea9f3073ee41fa3ff1
7
- data.tar.gz: f8a647ae5bb4a6a75c66c8e379c63bc828ae740a57c358dd8d57dcf4c2a09c4e3674510749fcc97ee6f50f42c5d37458f4e050ec133ba6bd685e43f9d852eb0e
6
+ metadata.gz: e14d4783d07bf5f6f295dbf73c294083b87079c8d06819706d72af8995679eed58319b71eea71dfb5ad44ee3b4a403fbb9f611aadcff3bf9789e6986d698be03
7
+ data.tar.gz: d87eb899827736a1e4a2319469d0b8bb6e68a4660dd749c3424f669e48e6b2f94e739695bf5bdd7ef4b3cabaa7d93d2952100d83562e77675a19f8e7f3b7873b
@@ -1,16 +1,15 @@
1
1
  #!/usr/bin/ruby
2
- require "pstore"
3
- require_relative "ConfigStore"
2
+ require 'pstore'
3
+ require_relative 'ConfigStore'
4
4
 
5
5
  class Doc
6
-
7
6
  def initialize(input = nil)
8
7
  @store = ConfigStore.new
9
8
  @config = read_config
10
9
  end
11
10
 
12
11
  def create_charter(name)
13
- write_template(name)
12
+ write_template(name)
14
13
  @config['session_name'] = name
15
14
  @config['current_session'] = "#{@config['session_folder']}/#{name}.md"
16
15
  @config['start_time'] = Time.now.strftime('%l:%M %P')
@@ -79,17 +78,19 @@ class Doc
79
78
  end
80
79
 
81
80
  def find_files_with_tags(tag)
82
- files = %x(grep -rnw -l --include=*.md #{@config['session_folder']} -e '@#{tag}').split('\n')
83
- puts "No charters with that tag" unless files.length > 0
84
- files.each do |file|
85
- puts file.split('/')
86
- end
81
+ found_files = false
82
+ Dir.glob("#{@config['session_folder']}/**/*.md") {|file|
83
+ if File.read(file).include?("@#{tag}")
84
+ found_files = true
85
+ puts file.split('/').last(2).join('/')
86
+ end
87
+ }
88
+ puts "No Charters with that tag" unless found_files
87
89
  end
88
90
 
89
91
  def show_all_charters
90
- files = Dir["#{@config['session_folder']}/*.md"]
91
- files.each do |file|
92
- puts file.split('/')[-1]
92
+ Dir.glob("#{@config['session_folder']}/**/*.md") do|file|
93
+ puts file.split('/').last(2).join('/')
93
94
  end
94
95
  end
95
96
 
@@ -134,6 +135,6 @@ class Doc
134
135
  end
135
136
 
136
137
  def write_config
137
- @store.write('config',@config)
138
+ @store.write('config', @config)
138
139
  end
139
140
  end
@@ -1,3 +1,3 @@
1
1
  module Charter
2
- VERSION = '0.0.13'
2
+ VERSION = '0.0.14'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Grossman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-21 00:00:00.000000000 Z
11
+ date: 2014-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake