Commit 9a36808edb3390d6e7c04e7108a36dddff3e93cd

Merge branch 'master' of git://gitorious.org/gitorious/mainline

Commit diff

.gitignore

 
1010config/ultrasphinx/production.conf
1111config/ultrasphinx/staging.conf
1212db/schema.rb
13db/*.sqlite3
1314.autotest
1415db/sphinx/*
toggle raw diff

HACKING

 
22
33=== Dependencies
44
5* bluecloth (http://rubyforge.org/projects/bluecloth/)
5Ruby libraries/bindings/gems
6
7* BlueCloth (http://rubyforge.org/projects/bluecloth/)
68* mime-types (http://rubyforge.org/projects/mime-types)
79* oniguruma (http://rubyforge.org/projects/oniguruma)
8** requires the oniguruma C library: (http://www.geocities.jp/kosako3/oniguruma/)
910* textpow (http://rubyforge.org/projects/textpow)
10* chronic
11* chronic (http://rubyforge.org/projects/chronic)
12* rmagick (http://rubyforge.org/projects/rmagick)
13
14Libraries/applications:
15
16* Git (http://git-scm.org)
17* Oniguruma C library (http://www.geocities.jp/kosako3/oniguruma/)
18* Sphinx (http://sphinxsearch.com/)
19
20(App is deployed on mysql, allthough source should be free of mysql-isms/quirks)
21
1122
1223=== The Hackers digest guide:
1324
3434
3535Consult the mailinglist (http://groups.google.com/group/gitorious) or drop in
3636by #gitorious on irc.freenode.net if you have questions.
37
38
39=== Tasks and other scripts
40
41* script/task_performer runs any tasks in the queue (creating repositories etc)
42* script/graph_generator generates graph.
43* rake ultrasphinx:index runs the search indexer
44
45
46=== Coding style
47
48* Two spaces, no tabs, for indention
49* Don't use and and or for boolean tests, instead always use && and ||
50* MyClass.my_method(my_arg) -- not my_method( my_arg ) or my_method my_arg
51* Unless presedence is an issue; do .. end for multi-line blocks, braces for single line blocks
52* Follow the conventions you see used in the source already
53
54(copied mostly verbatim from dev.rubyonrails.org)
55
toggle raw diff

app/helpers/blobs_helper.rb

 
2121
2222 def render_highlighted(text, filename, theme = "idle")
2323 syntax_name = Uv.syntax_names_for_data(filename, text).first #TODO: render a choice select box if > 1
24 highlighted = Uv.parse(text, "xhtml", syntax_name, false, theme)
24 begin
25 highlighted = Uv.parse(text, "xhtml", syntax_name, false, theme)
26 rescue => e
27 if e.to_s =~ /Oniguruma Error/
28 highlighted = text
29 else
30 raise e
31 end
32 end
2533 line_numbers_for(highlighted, theme)
2634 end
2735
toggle raw diff

app/models/merge_request.rb

 
77 :association_name => "user",
88 :field => "login",
99 :as => "proposed_by"
10 }]
10 }], :conditions => "status = 0"
1111
1212 attr_protected :user_id, :status
1313
toggle raw diff

app/models/repository.rb

 
182182 labels = []
183183 data = []
184184
185 max = 5
185 max = 8
186186 others = []
187187 top = sorted
188188
toggle raw diff

app/views/merge_requests/show.html.erb

 
1717
1818 <% if @merge_request.open? -%>
1919 <p>The simplest way to merge in these changes is to simply pull them in with the following command:</p>
20 <pre>git pull <%= @merge_request.source_repository.clone_url -%></pre>
20 <pre>git pull <%= @merge_request.source_repository.clone_url -%> <%= @merge_request.source_branch -%></pre>
2121 <% end -%>
2222<% end -%>
2323
toggle raw diff

config/initializers/ultrasphinx.rb

 
1414 Ultrasphinx::MAIN_INDEX,
1515 (Ultrasphinx::DELTA_INDEX if Ultrasphinx.delta_index_present?)
1616 ].compact,
17 :weights => { "title" => 2.0, "name" => 2.0 },
17 :weights => { "title" => 3.0, "name" => 2.0 },
1818 :class_names => [],
1919 :filters => {},
2020 :facets => []
toggle raw diff

config/ultrasphinx/default.base

 
7777 html_index_attrs =
7878
7979 # Enable these if you need wildcard searching. They will slow down indexing significantly.
80 # min_infix_len = 1
81 # enable_star = 1
80 min_infix_len = 1
81 enable_star = 1
8282
8383 charset_type = utf-8 # or sbcs (Single Byte Character Set)
8484 charset_table = 0..9, A..Z->a..z, -, _, ., &, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F,U+C5->U+E5, U+E5, U+C4->U+E4, U+E4, U+D6->U+F6, U+F6, U+16B, U+0c1->a, U+0c4->a, U+0c9->e, U+0cd->i, U+0d3->o, U+0d4->o, U+0da->u, U+0dd->y, U+0e1->a, U+0e4->a, U+0e9->e, U+0ed->i, U+0f3->o, U+0f4->o, U+0fa->u, U+0fd->y, U+104->U+105, U+105, U+106->U+107, U+10c->c, U+10d->c, U+10e->d, U+10f->d, U+116->U+117, U+117, U+118->U+119, U+11a->e, U+11b->e, U+12E->U+12F, U+12F, U+139->l, U+13a->l, U+13d->l, U+13e->l, U+141->U+142, U+142, U+143->U+144, U+144,U+147->n, U+148->n, U+154->r, U+155->r, U+158->r, U+159->r, U+15A->U+15B, U+15B, U+160->s, U+160->U+161, U+161->s, U+164->t, U+165->t, U+16A->U+16B, U+16B, U+16e->u, U+16f->u, U+172->U+173, U+173, U+179->U+17A, U+17A, U+17B->U+17C, U+17C, U+17d->z, U+17e->z,
toggle raw diff

db/schema.rb

 
0# This file is auto-generated from the current state of the database. Instead of editing this file,
1# please use the migrations feature of ActiveRecord to incrementally modify your database, and
2# then regenerate this schema definition.
3#
4# Note that this schema.rb definition is the authoritative source for your database schema. If you need
5# to create the application database on another system, you should be using db:schema:load, not running
6# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
7# you'll amass, the slower it'll run and the greater likelihood for issues).
8#
9# It's strongly recommended to check this file into your version control system.
10
11ActiveRecord::Schema.define(:version => 22) do
12
13 create_table "comments", :force => true do |t|
14 t.integer "user_id", :null => false
15 t.integer "repository_id", :null => false
16 t.string "sha1", :default => "", :null => false
17 t.text "body"
18 t.datetime "created_at"
19 t.datetime "updated_at"
20 t.integer "project_id"
21 end
22
23 add_index "comments", ["user_id"], :name => "index_comments_on_user_id"
24 add_index "comments", ["repository_id"], :name => "index_comments_on_repository_id"
25 add_index "comments", ["sha1"], :name => "index_comments_on_sha1"
26 add_index "comments", ["project_id"], :name => "index_comments_on_project_id"
27
28 create_table "committerships", :force => true do |t|
29 t.integer "user_id"
30 t.integer "repository_id"
31 t.integer "kind", :default => 2
32 t.datetime "created_at"
33 t.datetime "updated_at"
34 end
35
36 add_index "committerships", ["user_id"], :name => "index_permissions_on_user_id"
37 add_index "committerships", ["repository_id"], :name => "index_permissions_on_repository_id"
38
39 create_table "merge_requests", :force => true do |t|
40 t.integer "user_id"
41 t.integer "source_repository_id"
42 t.integer "target_repository_id"
43 t.text "proposal"
44 t.string "sha_snapshot"
45 t.integer "status", :default => 0
46 t.datetime "created_at"
47 t.datetime "updated_at"
48 t.string "source_branch"
49 t.string "target_branch"
50 end
51
52 add_index "merge_requests", ["user_id"], :name => "index_merge_requests_on_user_id"
53 add_index "merge_requests", ["source_repository_id"], :name => "index_merge_requests_on_source_repository_id"
54 add_index "merge_requests", ["target_repository_id"], :name => "index_merge_requests_on_target_repository_id"
55 add_index "merge_requests", ["status"], :name => "index_merge_requests_on_status"
56
57 create_table "projects", :force => true do |t|
58 t.string "title"
59 t.text "description"
60 t.integer "user_id"
61 t.datetime "created_at"
62 t.datetime "updated_at"
63 t.string "slug"
64 t.string "license"
65 t.string "home_url"
66 t.string "mailinglist_url"
67 t.string "bugtracker_url"
68 end
69
70 add_index "projects", ["slug"], :name => "index_projects_on_slug", :unique => true
71 add_index "projects", ["title"], :name => "index_projects_on_name"
72 add_index "projects", ["user_id"], :name => "index_projects_on_user_id"
73
74 create_table "repositories", :force => true do |t|
75 t.string "name"
76 t.integer "project_id"
77 t.integer "user_id"
78 t.datetime "created_at"
79 t.datetime "updated_at"
80 t.boolean "mainline", :default => false
81 t.integer "parent_id"
82 t.boolean "ready", :default => false
83 end
84
85 add_index "repositories", ["name"], :name => "index_repositories_on_name"
86 add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
87 add_index "repositories", ["user_id"], :name => "index_repositories_on_user_id"
88 add_index "repositories", ["parent_id"], :name => "index_repositories_on_parent_id"
89 add_index "repositories", ["ready"], :name => "index_repositories_on_ready"
90
91 create_table "ssh_keys", :force => true do |t|
92 t.integer "user_id"
93 t.text "key"
94 t.datetime "created_at"
95 t.datetime "updated_at"
96 t.boolean "ready", :default => false
97 end
98
99 add_index "ssh_keys", ["user_id"], :name => "index_ssh_keys_on_user_id"
100
101 create_table "taggings", :force => true do |t|
102 t.integer "tag_id"
103 t.integer "taggable_id"
104 t.string "taggable_type"
105 t.datetime "created_at"
106 end
107
108 add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
109 add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type"
110
111 create_table "tags", :force => true do |t|
112 t.string "name"
113 end
114
115 add_index "tags", ["name"], :name => "index_tags_on_name", :unique => true
116
117 create_table "tasks", :force => true do |t|
118 t.string "target_class"
119 t.string "command"
120 t.text "arguments"
121 t.boolean "performed", :default => false
122 t.datetime "performed_at"
123 t.datetime "created_at"
124 t.datetime "updated_at"
125 t.integer "target_id"
126 end
127
128 add_index "tasks", ["performed"], :name => "index_tasks_on_performed"
129
130 create_table "users", :force => true do |t|
131 t.string "login"
132 t.string "email"
133 t.string "crypted_password", :limit => 40
134 t.string "salt", :limit => 40
135 t.datetime "created_at"
136 t.datetime "updated_at"
137 t.string "remember_token"
138 t.datetime "remember_token_expires_at"
139 t.string "activation_code", :limit => 40
140 t.datetime "activated_at"
141 t.integer "ssh_key_id"
142 t.string "fullname"
143 t.text "url"
144 end
145
146 add_index "users", ["login"], :name => "index_users_on_login"
147 add_index "users", ["email"], :name => "index_users_on_email"
148 add_index "users", ["ssh_key_id"], :name => "index_users_on_ssh_key_id"
149
150end
toggle raw diff

lib/gitorious/graphs/builder.rb

 
11require "gruff"
22
3Gruff::Base::TITLE_MARGIN = 2.0
3silence_warnings do
4 Gruff::Base::TITLE_MARGIN = 2.0
5end
46
57module Gitorious
68 module Graphs
toggle raw diff

vendor/plugins/googlecharts/History.txt

 
0== 1.1.0
1* fixed another bug fix related to the uri escaping required to download the file properly.
2== 1.0.0
3* fixed the (URI::InvalidURIError) issue
4== 0.2.0
5* added export options (file and image tag)
6* added support for all arguments to be passed as a string or an array
7
8== 0.1.0 2007-12-11
9* fixed the axis labels
10
11== 0.0.3 2007-12-11
12* added :chart_background alias and fixed a bug related to the background colors.
13
14== 0.0.2 2007-12-11
15* added support for more features and aliases
16
17== 0.0.1 2007-12-08
18
19* 1 major enhancement:
20 * Initial release
toggle raw diff

vendor/plugins/googlecharts/License.txt

 
0Copyright (c) 2007 Matt Aimonetti
1
2Permission is hereby granted, free of charge, to any person obtaining
3a copy of this software and associated documentation files (the
4"Software"), to deal in the Software without restriction, including
5without limitation the rights to use, copy, modify, merge, publish,
6distribute, sublicense, and/or sell copies of the Software, and to
7permit persons to whom the Software is furnished to do so, subject to
8the following conditions:
9
10The above copyright notice and this permission notice shall be
11included in all copies or substantial portions of the Software.
12
13THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
17LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
toggle raw diff

vendor/plugins/googlecharts/Manifest.txt

 
0History.txt
1License.txt
2Manifest.txt
3README.txt
4Rakefile
5config/hoe.rb
6config/requirements.rb
7lib/gchart.rb
8lib/gchart/aliases.rb
9lib/gchart/version.rb
10log/debug.log
11script/destroy
12script/generate
13script/txt2html
14setup.rb
15spec/gchart_spec.rb
16spec/spec.opts
17spec/spec_helper.rb
18tasks/deployment.rake
19tasks/environment.rake
20tasks/rspec.rake
21tasks/website.rake
22website/index.html
23website/index.txt
24website/javascripts/rounded_corners_lite.inc.js
25website/stylesheets/screen.css
26website/template.rhtml
toggle raw diff

vendor/plugins/googlecharts/README.txt

 
0The goal of this Gem is to make the creation of Google Charts a simple and easy task.
1
2Gchart.line( :size => '200x300',
3 :title => "example title",
4 :bg => 'efefef',
5 :legend => ['first data set label', 'second data set label'],
6 :data => [10, 30, 120, 45, 72])
7
8
9
10==Chart Type
11
12This gem supports the following types of charts:
13
14 * line,
15 * line_xy
16 * scatter
17 * bar
18 * venn
19 * pie
20 * pie_3d
21
22To create a chart, simply require Gchart and call any of the existing type:
23
24 require 'gchart'
25 Gchart.pie
26
27
28==Chart Title
29
30 To add a title to a chart pass the title to your chart:
31
32 Gchart.line(:title => 'Sexy Charts!')
33
34You can also specify the color and/or size
35
36 Gchart.line(:title => 'Sexy Charts!', :title_color => 'FF0000', :title_size => '20')
37
38==Colors
39
40Specify a color with at least a 6-letter string of hexadecimal values in the format RRGGBB. For example:
41
42 * FF0000 = red
43 * 00FF00 = green
44 * 0000FF = blue
45 * 000000 = black
46 * FFFFFF = white
47
48You can optionally specify transparency by appending a value between 00 and FF where 00 is completely transparent and FF completely opaque. For example:
49
50 * 0000FFFF = solid blue
51 * 0000FF00 = transparent blue
52
53If you need to use multiple colors, check the doc. Usually you just need to pass :attribute => 'FF0000,00FF00'
54
55Some charts have more options than other, make sure to refer to the documentation.
56
57===Background options:
58
59If you don't set the background option, your graph will be transparent.
60
61* You have 3 types of background http://code.google.com/apis/chart/#chart_or_background_fill
62
63- solid
64- gradient
65- stripes
66
67By default, if you set a background color, the fill will be solid:
68
69 Gchart.bar(:bg => 'efefef')
70
71However you can specify another fill type such as:
72
73 Gchart.line(:bg => {:color => 'efefef', :type => 'gradient'})
74
75In the above code, we decided to have a gradient background, however since we only passed one color, the chart will start by the specified color and transition to white. By the default, the gradient angle is 0. Change it as follows:
76
77 Gchart.line(:title =>'bg example', :bg => {:color => 'efefef', :type => 'gradient', :angle => 90})
78
79For a more advance use of colors, refer to http://code.google.com/apis/chart/#linear_gradient
80
81 Gchart.line(:bg => {:color => '76A4FB,1,ffffff,0', :type => 'gradient'})
82
83
84The same way you set the background color, you can also set the graph background:
85
86 Gchart.line(:graph_bg => 'cccccc')
87
88or both
89
90 Gchart.line(:bg => {:color => '76A4FB,1,ffffff,0', :type => 'gradient'}, :graph_bg => 'cccccc', :title => 'Sexy Chart')
91
92
93Another type of fill is stripes http://code.google.com/apis/chart/#linear_stripes
94
95 Gchart.line(:bg => {:color => 'efefef', :type => 'stripes'})
96
97You can customize the amount of stripes, colors and width by changing the color value.
98
99
100== Legend & Labels
101
102You probably will want to use a legend or labels for your graph.
103
104 Gchart.line(:legend => 'legend label')
105or
106 Gchart.line(:legend => ['legend label 1', 'legend label 2'])
107
108Will do the trick. You can also use the labels alias (makes more sense when using the pie charts)
109
110 chart = Gchart.pie(:labels => ['label 1', 'label 2'])
111
112== Multiple axis labels
113
114Multiple axis labels are available for line charts, bar charts and scatter plots.
115
116* x = bottom x-axis
117* t = top x-axis
118* y = left y-axis
119* r = right y-axis
120
121 Gchart.line(:label_axis => 'x,y,r')
122
123To add labels on these axis:
124
125 Gchart.line(:axis_labels => ['Jan|July|Jan|July|Jan', '0|100', 'A|B|C', '2005|2006|2007'])
126
127
128== Data options
129
130Data are passed using an array or a nested array.
131
132 Gchart.bar(:data => [1,2,4,67,100,41,234])
133
134 Gchart.bar(:data => [[1,2,4,67,100,41,234],[45,23,67,12,67,300, 250]])
135
136By default, the graph is drawn with your max value representing 100% of the height or width of the graph. You can change that my passing the max value.
137
138 Gchart.bar(:data => [1,2,4,67,100,41,234], :max_value => 300)
139 Gchart.bar(:data => [1,2,4,67,100,41,234], :max_value => 'auto')
140
141or if you want to use the real values from your dataset:
142
143 Gchart.bar(:data => [1,2,4,67,100,41,234], :max_value => false)
144
145
146You can also define a different encoding to add more granularity:
147
148 Gchart.bar(:data => [1,2,4,67,100,41,234], :encoding => 'simple')
149 Gchart.bar(:data => [1,2,4,67,100,41,234], :encoding => 'extended')
150 Gchart.bar(:data => [1,2,4,67,100,41,234], :encoding => 'text')
151
152
153==Pies:
154
155you have 2 type of pies:
156 - Gchart.pie() the standard 2D pie
157 _ Gchart.pie_3d() the fancy 3D pie
158
159To set labels, you can use one of these two options:
160
161 @legend = ['Matt_fu', 'Rob_fu']
162 Gchart.pie_3d(:title => @title, :labels => @legend, :data => @data, :size => '400x200')
163 Gchart.pie_3d(:title => @title, :legend => @legend, :data => @data, :size => '400x200')
164
165
166
167=== try yourself
168
169Gchart.bar( :data => [[1,2,4,67,100,41,234],[45,23,67,12,67,300, 250]],
170 :title => 'SDRuby Fu level',
171 :legend => ['matt','patrick'],
172 :bg => {:color => '76A4FB', :type => 'gradient'},
173 :bar_colors => 'ff0000,00ff00')
174
175 "http://chart.apis.google.com/chart?chs=300x200&chdl=matt|patrick&chd=s:AAANUIv,JENCN9y&chtt=SDRuby+Fu+level&chf=bg,lg,0,76A4FB,0,ffffff,1&cht=bvs&chco=ff0000,00ff00"
176
177Gchart.pie(:data => [20,10,15,5,50], :title => 'SDRuby Fu level', :size => '400x200', :labels => ['matt', 'rob', 'patrick', 'ryan', 'jordan'])
178http://chart.apis.google.com/chart?cht=p&chs=400x200&chd=s:YMSG9&chtt=SDRuby+Fu+level&chl=matt|rob|patrick|ryan|jordan
toggle raw diff

vendor/plugins/googlecharts/Rakefile

 
0require 'config/requirements'
1require 'config/hoe' # setup Hoe + all gem configuration
2
3Dir['tasks/**/*.rake'].each { |rake| load rake }
toggle raw diff

vendor/plugins/googlecharts/config/hoe.rb

 
0require 'gchart/version'
1
2AUTHOR = 'Matt Aimonetti' # can also be an array of Authors
3EMAIL = "mattaimonetti@gmail.com"