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 +4 -4
- data/README.md +6 -6
- data/bin/charter +16 -4
- data/lib/charter/doc.rb +19 -22
- data/lib/charter/version.rb +1 -1
- data/lib/charter.rb +0 -3
- metadata +2 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ed848c8cf33280db48864918cb221b5e22c8129
|
4
|
+
data.tar.gz: 81b749c8221d89209511d47bce76ac786615c690
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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 '
|
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
|
-
|
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
|
-
|
36
|
-
|
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
|
-
|
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
|
-
|
136
|
+
@store.write('config',@config)
|
140
137
|
end
|
141
138
|
end
|
data/lib/charter/version.rb
CHANGED
data/lib/charter.rb
CHANGED
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.
|
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-
|
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:
|