charter 0.0.8 → 0.0.9

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: e1c3c8a659fec87f6007ed0b5effb44796e5974c
4
- data.tar.gz: d221a1bb32c56179c733dc5ac9f9b4df3d93c822
3
+ metadata.gz: 2ed848c8cf33280db48864918cb221b5e22c8129
4
+ data.tar.gz: 81b749c8221d89209511d47bce76ac786615c690
5
5
  SHA512:
6
- metadata.gz: d73ab94b12da179ccb525a5ef2063c68dd2822597610d776a66b2e0f89797e99e6df277b633f79fb43427ce9a065ab78b7bea8534c654569ba985205a005d00f
7
- data.tar.gz: 9a4e7277979fe9511f23ecbccb912e2d84e0ea08b2aac6671f9269d306e5d6a1df966b142cbe3c6d9814a3fe85ce43ebb78d46360cbbd3035d4effdd94729ab7
6
+ metadata.gz: 55d513e188876e13b5a9713cc32cf5ecd469c8d353c0c69f9b7407c5ab595fe7760d7881807114738c26fa36c3aba7736107558cbcf60e1e1283f67b27da8d1d
7
+ data.tar.gz: 036cdc29750c2a4e302fd0d8c3e56d12e8b3f71644878867f02810ff0468d28b11bb203839004f41e316700141e29ed71150c9f6dcdfb78a68d63ecc3417cc58
data/README.md CHANGED
@@ -3,11 +3,11 @@
3
3
  <code>[sudo] gem install charter</code>
4
4
 
5
5
  After installing the gem, create a ~/.charterrc file and add the following:
6
- {% codeblock lang:yaml %}
7
- ---
8
- session_folder: "/Where/The/Charters/Will/Save/To"
9
- tester: Your Name Here
10
- {% endcodeblock %}
6
+ ```
7
+ ---
8
+ session_folder: "/Where/The/Charters/Will/Save/To"
9
+ tester: Your Name Here
10
+ ```
11
11
  ##Usage
12
12
  charter [global options] command [command options] [arguments...]
13
13
 
@@ -22,4 +22,4 @@ Creating a new charter is as easy as <code>charter start "My charter title here"
22
22
  <code>charter finish</code> or <code>charter finish -e</code> : Remove any remaining placeholders and optionally export the charter in HTML
23
23
  <code>charter find Login</code> : Find all charters with a given tag
24
24
 
25
- See an example charter [here](http://testwith.me/charter-example/)
25
+ See an example charter [here](http://testwith.me/charter-example/)
data/bin/charter CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'gli'
3
3
  require 'charter'
4
+ require_relative "../lib/charter/ConfigStore"
4
5
 
5
6
  include GLI::App
6
7
 
@@ -10,6 +11,20 @@ program_desc 'A command line tool for session based testing'
10
11
 
11
12
  version Charter::VERSION
12
13
 
14
+ desc 'Configure Charter'
15
+ arg_name 'config'
16
+ command :config do |c|
17
+ c.action do |global_options, options, args|
18
+ store = ConfigStore.new
19
+ config = {}
20
+ puts "What's your name?"
21
+ config['tester'] = gets.chomp
22
+ puts "What folder would you like the sessions stored in?"
23
+ config['session_folder'] = gets.chomp
24
+ store.write('config', config)
25
+ end
26
+ end
27
+
13
28
  desc 'Starts a new session charter'
14
29
  arg_name 'SessionName'
15
30
  command :start do |c|
@@ -87,13 +102,10 @@ command :all do |c|
87
102
  end
88
103
 
89
104
  desc 'Final formatting to charter'
90
- arg_name 'Type of export'
105
+ arg_name 'Finish the charter'
91
106
  command :finish do |c|
92
- c.switch :e
93
107
  c.action do |global_options, options, args|
94
108
  doc.finish_charter
95
- doc.export_charter if options[:e]
96
-
97
109
  end
98
110
  end
99
111
 
data/lib/charter/doc.rb CHANGED
@@ -1,17 +1,16 @@
1
1
  #!/usr/bin/ruby
2
+ require "pstore"
3
+ require_relative "ConfigStore"
2
4
 
3
5
  class Doc
4
6
 
5
7
  def initialize(input = nil)
8
+ @store = ConfigStore.new
6
9
  @config = read_config
7
10
  end
8
11
 
9
12
  def create_charter(name)
10
- template = File.read(File.dirname(__FILE__) + '/charter_template.md')
11
- charter = File.new("#{@config['session_folder']}/#{name}.md", 'w+')
12
- charter.write(template)
13
- charter.close
14
-
13
+ write_template(name)
15
14
  @config['session_name'] = name
16
15
  @config['current_session'] = "#{@config['session_folder']}/#{name}.md"
17
16
  @config['start_time'] = Time.now.strftime('%l:%M %P')
@@ -25,6 +24,13 @@ class Doc
25
24
  write_config
26
25
  end
27
26
 
27
+ def write_template(name)
28
+ template = File.read(File.dirname(__FILE__) + '/charter_template.md')
29
+ charter = File.new("#{@config['session_folder']}/#{name}.md", 'w+')
30
+ charter.write(template)
31
+ charter.close
32
+ end
33
+
28
34
  def add_bug(text)
29
35
  replace_text('<defects>', "1. #{text} \r\n<defects>")
30
36
  @config['defects'] = 'true'
@@ -32,8 +38,12 @@ class Doc
32
38
  end
33
39
 
34
40
  def take_screenshot(text)
35
- %x(screencapture -s "#{@config['session_folder']}/#{text}".jpg)
36
- replace_text('<defects>', " * ![Alt text](#{@config['session_folder']}/#{text}.jpg) \r\n<defects>")
41
+ if Gem.win_platform?
42
+ %x(screencapture -s "#{@config['session_folder']}/#{text}".jpg)
43
+ replace_text('<defects>', " * ![Alt text](#{@config['session_folder']}/#{text}.jpg) \r\n<defects>")
44
+ else
45
+ puts "This isn't supported on you operating system"
46
+ end
37
47
  end
38
48
 
39
49
  def add_scenario(text)
@@ -68,15 +78,6 @@ class Doc
68
78
  remove_placeholders
69
79
  end
70
80
 
71
- def export_charter
72
- renderer = Redcarpet::Render::HTML.new(render_options = {})
73
- markdown = Redcarpet::Markdown.new(renderer, extensions = {})
74
- markdown_text = File.read(@config['current_session'])
75
- html_file = File.new("#{@config['session_folder']}/#{@config['session_name'].gsub(' ', '-')}.html", 'w+')
76
- html_text = markdown.render(markdown_text)
77
- html_file.write(html_text)
78
- end
79
-
80
81
  def find_files_with_tags(tag)
81
82
  files = %x(grep -rnw -l --include=*.md #{@config['session_folder']} -e '@#{tag}').split('\n')
82
83
  files.each do |file|
@@ -128,14 +129,10 @@ class Doc
128
129
  end
129
130
 
130
131
  def read_config
131
- if File.exist? File.expand_path(SESSION_CONFIG)
132
- return YAML.load_file(File.expand_path(SESSION_CONFIG))
133
- else
134
- return {}
135
- end
132
+ @store.read('config')
136
133
  end
137
134
 
138
135
  def write_config
139
- File.open(File.expand_path(SESSION_CONFIG), 'w') { |yf| YAML.dump(@config, yf) }
136
+ @store.write('config',@config)
140
137
  end
141
138
  end
@@ -1,3 +1,3 @@
1
1
  module Charter
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
data/lib/charter.rb CHANGED
@@ -1,9 +1,6 @@
1
1
  require 'charter/version.rb'
2
2
  require 'fileutils'
3
3
  require 'charter/doc.rb'
4
- require 'redcarpet'
5
4
  require 'yaml'
6
5
  require 'time'
7
6
  require 'date'
8
-
9
- SESSION_CONFIG = "~/.charterrc"
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.8
4
+ version: 0.0.9
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-04-15 00:00:00.000000000 Z
11
+ date: 2014-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,26 +66,6 @@ dependencies:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.9.0
69
- - !ruby/object:Gem::Dependency
70
- name: redcarpet
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.1'
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- version: 3.1.1
79
- type: :runtime
80
- prerelease: false
81
- version_requirements: !ruby/object:Gem::Requirement
82
- requirements:
83
- - - "~>"
84
- - !ruby/object:Gem::Version
85
- version: '3.1'
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: 3.1.1
89
69
  description: A tool for creating exploratory test session charters
90
70
  email: mark@testwith.me
91
71
  executables: