extract_ticket_numbers 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +23 -0
- data/Rakefile +1 -0
- data/bin/extract_ticket_numbers +22 -0
- data/extract_ticket_numbers.gemspec +26 -0
- data/lib/extract_ticket_numbers/version.rb +3 -0
- data/lib/extract_ticket_numbers.rb +15 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 878921041076d5a27740875b05afd75ca906214c
|
4
|
+
data.tar.gz: 4e7ca6508f02c6eb397112f5306b1c30530711f8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 44c04ed46a8c5dbada2ecf88cdef490dc601de230c6c7889df854c969a2c290b30a14d5c4f9cdc731e6309d0b3a68417b85dedc7dc27253610b52da6d8e2fda3
|
7
|
+
data.tar.gz: 695431d0a34fd19672811afe2700961d54ca62a80eaa3997d38edf2a41fee8171efc6758e9ce935a89886f67cf3233917f34f35c0d588cd4f3c23edee65678da
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Peter Ehrenberg
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# ExtractTicketNumber
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Install it as cli programm:
|
6
|
+
|
7
|
+
$ gem install extract_ticket_number
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
Describe available commands or one specific command:
|
12
|
+
|
13
|
+
$ extract_ticket_numbers help [COMMAND]
|
14
|
+
|
15
|
+
|
16
|
+
Extract ticket numbers from and add them to CSV file:
|
17
|
+
|
18
|
+
$ extract_ticket_numbers add_to_csv CSVFILE
|
19
|
+
|
20
|
+
## Example
|
21
|
+
|
22
|
+
$ extract_ticket_numbers add_to_csv blue_ant_report.csv
|
23
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
Encoding.default_external = Encoding::Windows_1252
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
6
|
+
|
7
|
+
require "thor"
|
8
|
+
require "extract_ticket_numbers"
|
9
|
+
|
10
|
+
class ExtractTicketNumbersCli < Thor
|
11
|
+
|
12
|
+
desc "add_to_csv CSVFILE", "extract ticket numbers from and add them to CSVFILE"
|
13
|
+
def add_to_csv(path)
|
14
|
+
ExtractTicketNumbers.add_to_csv(path)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
begin
|
19
|
+
ExtractTicketNumbersCli.start(ARGV)
|
20
|
+
rescue
|
21
|
+
warn $!
|
22
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'extract_ticket_numbers/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "extract_ticket_numbers"
|
8
|
+
spec.version = ExtractTicketNumbers::VERSION
|
9
|
+
spec.authors = ["Peter Ehrenberg"]
|
10
|
+
spec.email = ["pe@dipe.de"]
|
11
|
+
spec.summary =
|
12
|
+
%q{Reads CSV file, extract Jira ticket number from each line an add it as additional column.}
|
13
|
+
spec.description =
|
14
|
+
%q{It's build for using with our time tracking system BlueAnt. If you get a file with a work time report as CSV file, you can feed it to this extract_ticket_numbers. This program reads every line an try to match a ticket number looking like "ABC-123". If it found such number it will add it in to an additional last column of the CSV file.}
|
15
|
+
spec.homepage = ""
|
16
|
+
spec.license = "MIT"
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0")
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
24
|
+
spec.add_development_dependency "rake", "~> 10"
|
25
|
+
spec.add_development_dependency "thor", "~> 0"
|
26
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "extract_ticket_numbers/version"
|
2
|
+
require 'csv'
|
3
|
+
|
4
|
+
module ExtractTicketNumbers
|
5
|
+
|
6
|
+
def self.add_to_csv(in_path, out_path = in_path + '.with_ticket_numbers')
|
7
|
+
CSV.open(out_path, "wb", col_sep: ';') do |out_row|
|
8
|
+
CSV.foreach(in_path, col_sep: ';', headers: false).each do |in_row|
|
9
|
+
ticket = in_row.to_s.scan[/[a-zA-Z]+\-[0-9]+/].join(', ')
|
10
|
+
in_row << ticket
|
11
|
+
out_row << in_row
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: extract_ticket_numbers
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Ehrenberg
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: thor
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: It's build for using with our time tracking system BlueAnt. If you get
|
56
|
+
a file with a work time report as CSV file, you can feed it to this extract_ticket_numbers.
|
57
|
+
This program reads every line an try to match a ticket number looking like "ABC-123".
|
58
|
+
If it found such number it will add it in to an additional last column of the CSV
|
59
|
+
file.
|
60
|
+
email:
|
61
|
+
- pe@dipe.de
|
62
|
+
executables:
|
63
|
+
- extract_ticket_numbers
|
64
|
+
extensions: []
|
65
|
+
extra_rdoc_files: []
|
66
|
+
files:
|
67
|
+
- ".gitignore"
|
68
|
+
- Gemfile
|
69
|
+
- LICENSE.txt
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- bin/extract_ticket_numbers
|
73
|
+
- extract_ticket_numbers.gemspec
|
74
|
+
- lib/extract_ticket_numbers.rb
|
75
|
+
- lib/extract_ticket_numbers/version.rb
|
76
|
+
homepage: ''
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata: {}
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 2.4.5
|
97
|
+
signing_key:
|
98
|
+
specification_version: 4
|
99
|
+
summary: Reads CSV file, extract Jira ticket number from each line an add it as additional
|
100
|
+
column.
|
101
|
+
test_files: []
|