Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
38dc5847
Commit
38dc5847
authored
Oct 21, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved from albino -> pygments.rb
parent
6c0a38b6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
17 deletions
+21
-17
Gemfile
Gemfile
+1
-1
Gemfile.lock
Gemfile.lock
+7
-8
app/models/snippet.rb
app/models/snippet.rb
+1
-2
app/views/projects/_tree_file.html.haml
app/views/projects/_tree_file.html.haml
+1
-0
app/views/projects/empty.html.erb
app/views/projects/empty.html.erb
+4
-3
config/initializers/grit_ext.rb
config/initializers/grit_ext.rb
+1
-1
lib/utils.rb
lib/utils.rb
+6
-2
No files found.
Gemfile
View file @
38dc5847
...
...
@@ -15,7 +15,7 @@ gem 'therubyracer'
gem
'
faker
'
gem
'
seed-fu
'
,
:git
=>
'git://github.com/mbleigh/seed-fu.git'
gem
"
inifile
"
gem
"
albino
"
,
:git
=>
"git://github.com/gitlabhq/albino.git
"
gem
"
pygments.rb
"
,
"0.2.3
"
gem
"
kaminari
"
gem
"
thin
"
gem
"
git
"
...
...
Gemfile.lock
View file @
38dc5847
...
...
@@ -4,13 +4,6 @@ GIT
specs:
annotate (2.4.1.beta1)
GIT
remote: git://github.com/gitlabhq/albino.git
revision: 118380924969f3a856659f86ea1f40c1ba7bfcb1
specs:
albino (1.3.3)
posix-spawn (>= 0.3.6)
GIT
remote: git://github.com/gitlabhq/grit.git
revision: ff015074ef35bd94cba943f9c0f98e161ab5851c
...
...
@@ -72,6 +65,7 @@ GEM
ZenTest (= 4.5)
awesome_print (0.4.0)
bcrypt-ruby (3.0.1)
blankslate (2.1.2.4)
builder (3.0.0)
capybara (1.0.1)
mime-types (>= 1.16)
...
...
@@ -138,6 +132,8 @@ GEM
orm_adapter (0.0.5)
polyglot (0.3.2)
posix-spawn (0.3.6)
pygments.rb (0.2.3)
rubypython (>= 0.5.1)
rack (1.3.2)
rack-cache (1.0.3)
rack (>= 0.4)
...
...
@@ -189,6 +185,9 @@ GEM
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rubypython (0.5.1)
blankslate (>= 2.1.2.3)
ffi (~> 1.0.7)
rubyzip (0.9.4)
sass (3.1.7)
sass-rails (3.1.1)
...
...
@@ -242,7 +241,6 @@ PLATFORMS
DEPENDENCIES
acts_as_list
albino!
annotate!
autotest
autotest-rails
...
...
@@ -260,6 +258,7 @@ DEPENDENCIES
jquery-rails
kaminari
launchy
pygments.rb (= 0.2.3)
rails (= 3.1.0)
rails-footnotes (>= 3.7.5.rc4)
rspec-rails
...
...
app/models/snippet.rb
View file @
38dc5847
...
...
@@ -32,8 +32,7 @@ class Snippet < ActiveRecord::Base
end
def
colorize
ft
=
handle_file_type
(
file_name
)
Albino
.
colorize
(
content
,
ft
,
:html
,
'utf-8'
,
"linenos=True"
)
system_colorize
(
content
,
file_name
)
end
end
# == Schema Information
...
...
app/views/projects/_tree_file.html.haml
View file @
38dc5847
:css
.view_file
.view_file_header
%strong
...
...
app/views/projects/empty.html.erb
View file @
38dc5847
<%
bash_lexer
=
Pygments
::
Lexer
[
:bash
]
%>
<div
class=
""
>
<div
class=
"git-empty"
>
<h2>
Git global setup:
</h2>
...
...
@@ -6,7 +7,7 @@ git config --global user.name "#{current_user.name}"
git config --global user.email "
#{
current_user
.
email
}
"
eos
%>
<%=
raw
Albino
.
colorize
(
setup_str
,
:bash
)
%>
<%=
raw
bash_lexer
.
highlight
(
setup_str
)
%>
<br
/>
<br
/>
<h2>
Next steps:
</h2>
...
...
@@ -21,7 +22,7 @@ git remote add origin #{@project.url_to_repo}
git push -u origin master
eos
%>
<%=
raw
Albino
.
colorize
(
repo_setup_str
,
:bash
)
%>
<%=
raw
bash_lexer
.
highlight
(
repo_setup_str
)
%>
<br
/><br
/>
<h2>
Existing Git Repo?
</h2>
...
...
@@ -31,7 +32,7 @@ git remote add origin #{@project.url_to_repo}
git push -u origin master
eos
%>
<%=
raw
Albino
.
colorize
(
exist_repo_setup_str
,
:bash
)
%>
<%=
raw
bash_lexer
.
highlight
(
exist_repo_setup_str
)
%>
<br
/><br
/>
<h2>
Remove this project?
</h2>
...
...
config/initializers/grit_ext.rb
View file @
38dc5847
require
'grit'
require
'
albino
'
require
'
pygments
'
require
"utils"
Grit
::
Blob
.
class_eval
do
...
...
lib/utils.rb
View file @
38dc5847
...
...
@@ -18,8 +18,12 @@ module Utils
module
Colorize
def
colorize
ft
=
handle_file_type
(
name
,
mime_type
)
Albino
.
colorize
(
data
,
ft
,
:html
,
'utf-8'
,
"linenos=True"
)
system_colorize
(
data
,
name
)
end
def
system_colorize
(
data
,
file_name
)
ft
=
handle_file_type
(
file_name
)
Pygments
.
highlight
(
data
,
:lexer
=>
ft
,
:options
=>
{
:encoding
=>
'utf-8'
,
:linenos
=>
'True'
})
end
def
handle_file_type
(
file_name
,
mime_type
=
nil
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment