zitgit 0.0.1 → 0.0.2

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.
data/README.md CHANGED
@@ -1,29 +1,22 @@
1
1
  # Zitgit
2
2
 
3
- TODO: Write a gem description
3
+ Simple sinatra-based web-interface to view git repository history
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
+ gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d'
9
10
  gem 'zitgit'
10
11
 
11
12
  And then execute:
12
13
 
13
- $ bundle
14
+ $ bundle install
14
15
 
15
- Or install it yourself as:
16
-
17
- $ gem install zitgit
16
+ You can not just run gem install zitgit because it has dependencies from GitHub
18
17
 
19
18
  ## Usage
20
19
 
21
- TODO: Write usage instructions here
22
-
23
- ## Contributing
20
+ Just run `zitgit` from git repo folder and view your repository history on http://localhost:5555
24
21
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
22
+ Or you can run it on different port with `zitgit -p <port_number>`
data/bin/zitgit CHANGED
@@ -1,4 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'zitgit'
4
- Zitgit::Zitgit.run!
4
+ require 'optparse'
5
+
6
+ port = 5555
7
+
8
+ OptionParser.new do |opts|
9
+ opts.on("-p PORT", "--port PORT", Integer) do |v|
10
+ port = v
11
+ end
12
+ end.parse!
13
+
14
+ Zitgit::Zitgit.run!(:port => port)
data/lib/zitgit.rb CHANGED
@@ -32,18 +32,15 @@ module Zitgit
32
32
 
33
33
  get '/' do
34
34
  repo = Grit::Repo.new('.')
35
- current_branch = Grit::Head.current(repo)
36
- commits = repo.commits(current_branch.name, 200)
37
- repo_name = File.basename(repo.working_dir)
35
+ @current_branch = Grit::Head.current(repo)
36
+ @commits = repo.commits(@current_branch.name, 200)
37
+ @last_commit = @commits[0]
38
+ @repo_name = File.basename(repo.working_dir)
38
39
  @branches = repo.heads
39
40
  @remotes = repo.remotes
40
41
  @tags = repo.tags
41
- slim :index, :locals => {
42
- current_branch: current_branch,
43
- commits: commits,
44
- repo_name: repo_name,
45
- last_commit: commits[0]
46
- }
42
+ @index = repo.index
43
+ slim :index
47
44
  end
48
45
 
49
46
  get "/ref/:ref_name" do |ref_name|
@@ -1,3 +1,3 @@
1
1
  module Zitgit
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -52,3 +52,7 @@ $ ->
52
52
  railalign: 'left',
53
53
  horizrailenabled: false
54
54
  })
55
+ $('.diffs li').niceScroll({
56
+ cursorcolor: '#ccc',
57
+ cursorwidth: 14,
58
+ })
@@ -58,12 +58,16 @@
58
58
  cursorcolor: '#ccc',
59
59
  cursorwidth: 14
60
60
  });
61
- return $('.history').niceScroll({
61
+ $('.history').niceScroll({
62
62
  cursorcolor: '#ccc',
63
63
  cursorwidth: 14,
64
64
  railalign: 'left',
65
65
  horizrailenabled: false
66
66
  });
67
+ return $('.diffs li').niceScroll({
68
+ cursorcolor: '#ccc',
69
+ cursorwidth: 14
70
+ });
67
71
  });
68
72
 
69
73
  }).call(this);
data/views/index.slim CHANGED
@@ -3,7 +3,7 @@ nav.top-bar
3
3
  li.name
4
4
  h1
5
5
  a
6
- = repo_name
6
+ = @repo_name
7
7
  section.top-bar-section
8
8
  ul.left
9
9
  li.divider
@@ -11,7 +11,7 @@ nav.top-bar
11
11
  a Branches:
12
12
  li.has-dropdown
13
13
  a.active.current_branch
14
- = current_branch.name
14
+ = @current_branch.name
15
15
  ul.dropdown.branches
16
16
  == slim :'refs/dropdown', :locals => {refs: @branches}, :layout => false
17
17
  li.divider
@@ -31,6 +31,6 @@ nav.top-bar
31
31
  .loader
32
32
  .main.row
33
33
  .history.large-6.columns
34
- == slim :'commits/list', :locals => {commits: commits}, :layout => false
34
+ == slim :'commits/list', :locals => {commits: @commits}, :layout => false
35
35
  .show_commit.large-6.columns
36
- == slim :'commits/detail', :locals => {commit: last_commit}, :layout => false
36
+ == slim :'commits/detail', :locals => {commit: @last_commit}, :layout => false
data/zitgit.gemspec CHANGED
@@ -27,4 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'guard-sass', "~> 1.0"
28
28
  spec.add_development_dependency 'guard-coffeescript', "~> 1.3"
29
29
  spec.add_development_dependency 'therubyracer', "~> 0.11"
30
+ spec.add_development_dependency 'rb-readline', "~> 0.4"
30
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zitgit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-25 00:00:00.000000000 Z
12
+ date: 2013-05-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -139,6 +139,22 @@ dependencies:
139
139
  - - ~>
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0.11'
142
+ - !ruby/object:Gem::Dependency
143
+ name: rb-readline
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ~>
148
+ - !ruby/object:Gem::Version
149
+ version: '0.4'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ~>
156
+ - !ruby/object:Gem::Version
157
+ version: '0.4'
142
158
  description: Simple sinatra-based web-interface to view git repository history
143
159
  email:
144
160
  - oleg0potapov@gmail.com