taco_it 1.2.1 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/taco CHANGED
@@ -601,6 +601,8 @@ DefaultStatus = Open
601
601
  DefaultPriority = 3
602
602
  EOT
603
603
  RETRY_NAME = '.taco_retry.txt'
604
+ INDEX_ERB_NAME = '.index.html.erb'
605
+ INDEX_ERB_SRC_PATH = File.realpath(File.join(File.dirname(__FILE__), '../lib/taco/defaults/index.html.erb'))
604
606
 
605
607
  class ParseError < Exception; end
606
608
 
@@ -612,12 +614,17 @@ EOT
612
614
  @rc_path = File.join(@taco.home, RC_NAME)
613
615
  @config = parse_rc
614
616
 
617
+ @index_erb_path = File.join(@taco.home, INDEX_ERB_NAME)
618
+
615
619
  Issue.set_allowed_values! @config[:allowed]
616
620
  end
617
621
 
618
622
  def init!
619
623
  out = @taco.init!
620
624
  open(@rc_path, 'w') { |f| f.write(RC_TEXT) }
625
+
626
+ FileUtils.copy(INDEX_ERB_SRC_PATH, @index_erb_path)
627
+
621
628
  out + "\nPlease edit the config file at #{@rc_path}"
622
629
  end
623
630
 
@@ -678,6 +685,13 @@ EOT
678
685
  end
679
686
  end
680
687
 
688
+ def html
689
+ require 'erb'
690
+
691
+ issues = @taco.list
692
+ ERB.new(open(@index_erb_path) { |f| f.read }).result(binding)
693
+ end
694
+
681
695
  def push(opts)
682
696
  opts[:message] ||= 'turn and face the strange'
683
697
  cmd = "git add . && git commit -am '#{opts[:message]}' && git push"
@@ -737,7 +751,7 @@ end
737
751
  require 'commander/import'
738
752
 
739
753
  program :name, 'taco'
740
- program :version, '1.2.1'
754
+ program :version, '1.3.1'
741
755
  program :description, 'simple command line issue tracking'
742
756
 
743
757
  command :init do |c|
@@ -869,6 +883,24 @@ command :template do |c|
869
883
  end
870
884
  end
871
885
 
886
+ command :html do |c|
887
+ c.syntax = 'taco html'
888
+ c.summary = 'Generate an HTML buglist'
889
+ c.description = 'Generate an HTML buglist from index.html.erb'
890
+
891
+ c.action do |args, options|
892
+ begin
893
+ # FIXME: merge this kind of thing into commander: tell it how many arguments we expect.
894
+ raise ArgumentError.new("Unexpected arguments: #{args.join(', ')}") unless args.size == 0
895
+
896
+ puts cli.html
897
+ rescue Exception => e
898
+ puts "Error: #{e}"
899
+ exit 1
900
+ end
901
+ end
902
+ end
903
+
872
904
  command :push do |c|
873
905
  c.syntax = 'taco push'
874
906
  c.summary = 'Add, commit, and push all changes to git remote.'
@@ -0,0 +1,62 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>:: issues by taco ::</title>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7
+
8
+ <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
9
+ <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
10
+ <script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
11
+
12
+ <script>
13
+ $(document).ready(function() {
14
+ })
15
+ </script>
16
+ </head>
17
+
18
+ <body>
19
+ <div class="container">
20
+ <div class="row">
21
+ <h2>Issues</h2>
22
+ <table class="table table-bordered table-striped">
23
+ <thead>
24
+ <tr>
25
+ <th>Issue ID</th>
26
+ <th>Created</th>
27
+ <th>Priority</th>
28
+ <th>Status</th>
29
+ <th>Owner</th>
30
+ <th>Summary</th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ <% issues.each do |issue| %>
35
+ <tr>
36
+ <td><a href="#" data-toggle="modal" data-target="#modal-<%= issue.id %>"><%= issue.id %></a></td>
37
+
38
+ <td><%= issue.created_at.strftime("%Y/%m/%d") %></td>
39
+ <td><%= issue.priority %></td>
40
+ <td><%= issue.status %></td>
41
+ <td><%= issue.owner %></td>
42
+ <td><%= issue.summary %></td>
43
+ </tr>
44
+ <% end %>
45
+ </tbody>
46
+ </table>
47
+ </div>
48
+ </div>
49
+ </body>
50
+
51
+ <% issues.each do |issue| %>
52
+ <div id="modal-<%= issue.id %>" class="modal hide fade" tabindex="-1" role="dialog">
53
+ <div class="modal-header">
54
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
55
+ <h3><%= issue.summary %></h3>
56
+ </div>
57
+ <div class="modal-body">
58
+ <pre><%= issue.to_s %></pre>
59
+ </div>
60
+ </div>
61
+ <% end %>
62
+ </html>
data/lib/taco.rb CHANGED
@@ -601,6 +601,8 @@ DefaultStatus = Open
601
601
  DefaultPriority = 3
602
602
  EOT
603
603
  RETRY_NAME = '.taco_retry.txt'
604
+ INDEX_ERB_NAME = '.index.html.erb'
605
+ INDEX_ERB_SRC_PATH = File.realpath(File.join(File.dirname(__FILE__), '../lib/taco/defaults/index.html.erb'))
604
606
 
605
607
  class ParseError < Exception; end
606
608
 
@@ -612,12 +614,17 @@ EOT
612
614
  @rc_path = File.join(@taco.home, RC_NAME)
613
615
  @config = parse_rc
614
616
 
617
+ @index_erb_path = File.join(@taco.home, INDEX_ERB_NAME)
618
+
615
619
  Issue.set_allowed_values! @config[:allowed]
616
620
  end
617
621
 
618
622
  def init!
619
623
  out = @taco.init!
620
624
  open(@rc_path, 'w') { |f| f.write(RC_TEXT) }
625
+
626
+ FileUtils.copy(INDEX_ERB_SRC_PATH, @index_erb_path)
627
+
621
628
  out + "\nPlease edit the config file at #{@rc_path}"
622
629
  end
623
630
 
@@ -678,6 +685,13 @@ EOT
678
685
  end
679
686
  end
680
687
 
688
+ def html
689
+ require 'erb'
690
+
691
+ issues = @taco.list
692
+ ERB.new(open(@index_erb_path) { |f| f.read }).result(binding)
693
+ end
694
+
681
695
  def push(opts)
682
696
  opts[:message] ||= 'turn and face the strange'
683
697
  cmd = "git add . && git commit -am '#{opts[:message]}' && git push"
@@ -737,7 +751,7 @@ end
737
751
  require 'commander/import'
738
752
 
739
753
  program :name, 'taco'
740
- program :version, '1.2.1'
754
+ program :version, '1.3.1'
741
755
  program :description, 'simple command line issue tracking'
742
756
 
743
757
  command :init do |c|
@@ -869,6 +883,24 @@ command :template do |c|
869
883
  end
870
884
  end
871
885
 
886
+ command :html do |c|
887
+ c.syntax = 'taco html'
888
+ c.summary = 'Generate an HTML buglist'
889
+ c.description = 'Generate an HTML buglist from index.html.erb'
890
+
891
+ c.action do |args, options|
892
+ begin
893
+ # FIXME: merge this kind of thing into commander: tell it how many arguments we expect.
894
+ raise ArgumentError.new("Unexpected arguments: #{args.join(', ')}") unless args.size == 0
895
+
896
+ puts cli.html
897
+ rescue Exception => e
898
+ puts "Error: #{e}"
899
+ exit 1
900
+ end
901
+ end
902
+ end
903
+
872
904
  command :push do |c|
873
905
  c.syntax = 'taco push'
874
906
  c.summary = 'Add, commit, and push all changes to git remote.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taco_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,6 +36,7 @@ extensions: []
36
36
  extra_rdoc_files: []
37
37
  files:
38
38
  - lib/taco.rb
39
+ - lib/taco/defaults/index.html.erb
39
40
  - bin/taco
40
41
  homepage: http://github.com/mikepartelow/taco
41
42
  licenses: []