Neurogami-ghissues 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -23,6 +23,9 @@ PROJ.authors = 'James Britt'
23
23
  PROJ.email = 'james@neurogami.com'
24
24
  PROJ.url = 'http://neurogami.com/code'
25
25
  PROJ.version = Ghissues::VERSION
26
+ PROJ.readme_file = 'README.markdown'
27
+ PROJ.summary = 'CLI tool for GitHub "Issues" API'
28
+
26
29
  PROJ.rubyforge.name = 'ghissues' # There is no RF project
27
30
 
28
31
  PROJ.spec.opts << '--color'
@@ -14,17 +14,15 @@ def help
14
14
  Lists open issues
15
15
 
16
16
  ghissues create
17
- Creates a new issue. You get prompted for the title and details "
18
- end
19
-
17
+ Creates a new issue. You get prompted for the title and details
20
18
 
19
+ ghissues configure
20
+ Writes out a template .ghissues file
21
+ "
22
+ end
21
23
 
22
24
  (help; exit) if ARGV.empty?
23
25
 
24
- #begin
25
- Neurogami::GHIssues.send *ARGV
26
- #rescue Exception
27
- # warn "Yikes! Error invoking #{arg}:\n#{$!.inspect}"
28
- #end
26
+ Neurogami::GHIssues.send *ARGV
29
27
 
30
28
 
@@ -3,11 +3,22 @@ require 'yaml'
3
3
  require 'net/http'
4
4
  require 'uri'
5
5
  require 'yaml'
6
+ require 'fileutils'
6
7
 
7
8
  module Neurogami
8
9
  class GHIssues
9
10
  class << self
10
11
 
12
+ # Maybe some prompts?
13
+ def configure *args
14
+ STDERR.puts( ":DEBUG #{__FILE__}:#{__LINE__}" ) if ENV['JAMES_SCA_JDEV_MACHINE'] # JGBDEBUG
15
+ File.open('.ghissues', 'w') { |f|
16
+ f.puts "owner: RepoOwnerName
17
+ repo: repo-name
18
+ issues_cache_file: .ghcache/issues.yaml"
19
+ }
20
+ end
21
+
11
22
  def open *args
12
23
  nocache = args && args.first =~ /reload|refresh/i
13
24
  paged_issues nocache
@@ -26,6 +37,7 @@ module Neurogami
26
37
  private
27
38
 
28
39
  def read_config
40
+ STDERR.puts( ":DEBUG #{__FILE__}:#{__LINE__}" ) if ENV['JAMES_SCA_JDEV_MACHINE'] # JGBDEBUG
29
41
  begin
30
42
  @@config_file = "#{Dir.pwd}/.ghissues"
31
43
  unless File.exist? @@config_file
@@ -58,7 +70,9 @@ module Neurogami
58
70
  def paged_issues no_cache = false
59
71
  ARGV.clear
60
72
  warn "Hit enter after each issue to see the next one"
61
- issues(no_cache).each do |issue|
73
+
74
+ # Yeah, this is some flow-control spooky code. But it works! Do not try this at home. :)
75
+ ( issues(no_cache) || (warn("No issues."); return ) ).each do |issue|
62
76
  ___
63
77
  warn "Title: #{issue['title']}"
64
78
  warn "Details: \n#{issue['body']}"
@@ -73,6 +87,8 @@ module Neurogami
73
87
  issues_cache = config['issues_cache_file'] || 'issues.yaml'
74
88
  if no_cache || !File.exist?(issues_cache)
75
89
  warn "Reloading issues from GitHub ..."
90
+ config_dir = File.dirname( File.expand_path(issues_cache) )
91
+ FileUtils.mkdir_p config_dir unless File.exist?(config_dir)
76
92
  File.open(issues_cache, 'w'){ |f| f.puts get_issues }
77
93
  end
78
94
  YAML.load(IO.read(issues_cache))['issues']
@@ -2,6 +2,6 @@
2
2
  module Ghissues
3
3
 
4
4
  # :stopdoc:
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
 
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Neurogami-ghissues
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Britt
@@ -45,11 +45,10 @@ files:
45
45
  - test/test_ghissues.rb
46
46
  has_rdoc: false
47
47
  homepage: http://github.com/Neurogami/ghissues/tree/master
48
- licenses:
49
48
  post_install_message:
50
49
  rdoc_options:
51
50
  - --main
52
- - README.txt
51
+ - README.markdown
53
52
  require_paths:
54
53
  - lib
55
54
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -67,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
66
  requirements: []
68
67
 
69
68
  rubyforge_project: ghissues
70
- rubygems_version: 1.3.5
69
+ rubygems_version: 1.2.0
71
70
  signing_key:
72
71
  specification_version: 3
73
72
  summary: Neurogami::GHIssues lets you do some basic interaction with the GitHub 'issues' Web API.