climine 0.0.3 → 0.0.4

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: 73c2ae7d410ea2c4f64734edc0c725702318fdc7
4
- data.tar.gz: 6e7f7504d53ad53eab3d742f007c61271bb3b3cb
3
+ metadata.gz: f71c5ec923fc8ef50b38a99b1dc54d66c302d563
4
+ data.tar.gz: 6df0751757a301c4f0bb64c5591b703b509bf5a0
5
5
  SHA512:
6
- metadata.gz: 2544c127566dd18abffcca99ee972591a57a595f6dcc3d36964bf1be3c48e95f821e9e7d1307541b81ac0bbe598f0d046e1763a2e59effbd027daa65d4e418ef
7
- data.tar.gz: 6b8351506800c2f4eed1cd50690811fba4fa617e81e8cb0abf3bea56c4c395d2965420c7c11b5aa99f11b2d2717fb2489fcd1a3d1c64b56e0c561110af9266e9
6
+ metadata.gz: b234eab4fa83f16984bd3fd22ec8dc1ae4a378ea497e9189626f691025c5f9f45b9d86b7143e33353cdd3fe4811e20ea1af5f0effb5a19e0deccf0b03dbf6074
7
+ data.tar.gz: 9ce03d17057fe3a9c4f643f0159c3f1ab42fcc19c39dc5f23ffbb40f238ff77f76cf73eda9051d837bf7553520de2dd7fbd146ef019defd2733ddcbbc15588da
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- climine (0.0.3)
4
+ climine (0.0.4)
5
5
  hashie (~> 2.0.5)
6
6
  hirb (~> 0.7)
7
7
  hirb-unicode (~> 0.0.5)
data/README.md CHANGED
@@ -26,12 +26,18 @@ create `config.yml`
26
26
  $ climine init -k xxxx -u http://xxxx.xxx.xx/ -e `which emacs`
27
27
  ```
28
28
 
29
- ```config.yml
29
+ ```climine.yml
30
30
  url: http://xxxx.xxx.xx/
31
31
  apikey: xxxx
32
32
  editor: /path/to/emacs
33
33
  ```
34
34
 
35
+ Path of the configuration file can also be specified in the environment variable.
36
+
37
+ ```
38
+ export CLIMINE_CONF=path/to/climine.yml
39
+ ```
40
+
35
41
  ### Help
36
42
 
37
43
  - show all help
@@ -80,7 +86,7 @@ get Redmine Issues. see) http://www.redmine.org/projects/redmine/wiki/Rest_Issue
80
86
 
81
87
  ```
82
88
  Usage:
83
- climine get [TICKET_NO]
89
+ climine issue get [TICKET_NO]
84
90
 
85
91
  Options:
86
92
  -t, [--template=TEMPLATE_PATH] # rendering by given template
@@ -91,14 +97,14 @@ get Redmine Issues. see) http://www.redmine.org/projects/redmine/wiki/Rest_Issue
91
97
  You can be rendered using the your own ERB template file.
92
98
 
93
99
  ```
94
- $ climine issue (get|issue) -t [template_path]
100
+ $ climine issue (get|list) -t [template_path]
95
101
  ```
96
102
 
97
103
  #### create issue
98
104
 
99
105
  ```
100
106
  Usage:
101
- climine new
107
+ climine issue new
102
108
 
103
109
  Options:
104
110
  -p, [--project=PROJECT_ID] # project_id (search by `project` command)
data/bin/climine CHANGED
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'climine'
4
+
5
+ Signal.trap(:INT) {
6
+ puts "\nbye..."
7
+ exit(0)
8
+ }
9
+
4
10
  Climine::CLI.start(ARGV)
data/climine.yml ADDED
@@ -0,0 +1,3 @@
1
+ url: http://www21124ue.sakura.ne.jp/redmine/
2
+ apikey: 7cf7f32a9b0a0e1667157a5f3de05813be13ed54
3
+ editor: /usr/bin/emacs
@@ -2,7 +2,7 @@ require 'erb'
2
2
 
3
3
  module Climine::Command
4
4
  class Config < Base
5
- CONFIG = "config.yml"
5
+ CONFIG = "climine.yml"
6
6
  TEMPLATE = <<-ERB
7
7
  url: <%= options[:url] %>
8
8
  apikey: <%= options[:key] %>
@@ -13,11 +13,13 @@ editor: <%= options[:editor] %>
13
13
 
14
14
  default_command :init
15
15
 
16
- desc "init ", "initialize config.yml"
16
+ desc "init ", "initialize climine.yml"
17
17
  option :url, required: true, type: :string, aliases: '-u', banner: "RedmineURL", desc: "Your Redmine's URL"
18
18
  option :key, required: true, type: :string, aliases: '-k', banner: "API-Access-Key", desc: "Your API Access Key"
19
19
  option :editor, required: false, type: :string, aliases: '-e', banner: "Editor command or path", desc: "Your favorite editor ex) emacs or vim or /usr/bin/emacs etc..."
20
20
  def init
21
+ return if File.exist?(CONFIG) and !yes?("Overwrite? [#{CONFIG}] (y/n)", :green)
22
+
21
23
  open(CONFIG, 'w'){|file| file.write(ERB.new(TEMPLATE, nil, "-").result(binding)) }
22
24
  puts "create [ #{File.expand_path(CONFIG)} ]"
23
25
  end
@@ -3,6 +3,6 @@ require "yaml"
3
3
 
4
4
  class Climine::Config < Hashie::Mash
5
5
  def initialize
6
- super YAML.load_file('config.yml')
6
+ super YAML.load_file(ENV['CLIMINE_CONF'] || 'climine.yml')
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Climine
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: climine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - yagince
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-11 00:00:00.000000000 Z
11
+ date: 2014-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -132,6 +132,7 @@ extra_rdoc_files: []
132
132
  files:
133
133
  - bin/climine
134
134
  - climine.gemspec
135
+ - climine.yml
135
136
  - config.yml
136
137
  - Gemfile
137
138
  - Gemfile.lock