From 07b7ddded3fb769121010171c741cb74397d3830 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Wed, 16 Nov 2011 22:05:00 +0400 Subject: [PATCH 1/9] enable ruby-debug again --- Gemfile | 2 +- Gemfile.lock | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index cd10715950b..f1f1791210b 100644 --- a/Gemfile +++ b/Gemfile @@ -39,7 +39,7 @@ group :development, :test do gem 'capybara' gem 'autotest' gem 'autotest-rails' - # gem 'ruby-debug19', :require => 'ruby-debug' + gem 'ruby-debug19', :require => 'ruby-debug' gem 'awesome_print' gem 'database_cleaner' gem 'launchy' diff --git a/Gemfile.lock b/Gemfile.lock index a8dcd49f8c9..a0d9d664645 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,6 +50,7 @@ GEM acts_as_list (0.1.4) addressable (2.2.6) ansi (1.4.1) + archive-tar-minitar (0.5.2) arel (2.2.1) autotest (4.4.6) ZenTest (>= 4.4.1) @@ -77,6 +78,7 @@ GEM coffee-script-source execjs coffee-script-source (1.1.3) + columnize (0.3.4) daemons (1.1.4) database_cleaner (0.7.0) devise (1.5.0) @@ -113,6 +115,8 @@ GEM letter_opener (0.0.2) launchy libv8 (3.3.10.4) + linecache19 (0.5.12) + ruby_core_source (>= 0.1.4) mail (2.3.0) i18n (>= 0.4.0) mime-types (~> 1.16) @@ -168,6 +172,16 @@ GEM activesupport (~> 3.0) railties (~> 3.0) rspec (~> 2.7.0) + ruby-debug-base19 (0.11.25) + columnize (>= 0.3.1) + linecache19 (>= 0.5.11) + ruby_core_source (>= 0.1.4) + ruby-debug19 (0.11.6) + columnize (>= 0.3.1) + linecache19 (>= 0.5.11) + ruby-debug-base19 (>= 0.11.19) + ruby_core_source (0.1.5) + archive-tar-minitar (>= 0.5.2) rubypython (0.5.3) blankslate (>= 2.1.2.3) ffi (~> 1.0.7) @@ -254,6 +268,7 @@ DEPENDENCIES rails-footnotes (~> 3.7.5) rdiscount rspec-rails + ruby-debug19 sass-rails (~> 3.1.0) seed-fu (~> 2.1.0) shoulda (~> 3.0.0.beta2) -- GitLab From c0dbebb11d7f077d1d203c51b876e06bebea6235 Mon Sep 17 00:00:00 2001 From: Ricardo Rauch Date: Thu, 17 Nov 2011 16:30:57 -0300 Subject: [PATCH 2/9] fixing error messages --- app/assets/stylesheets/style.scss | 58 ++++++++++++++++++++++---- app/views/layouts/_head_panel.html.erb | 6 +-- 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/style.scss b/app/assets/stylesheets/style.scss index 1f3fa1b70f4..771fe48bf38 100644 --- a/app/assets/stylesheets/style.scss +++ b/app/assets/stylesheets/style.scss @@ -74,7 +74,6 @@ $blue_link: "#2fa0bb"; /* eo Vars */ html{ -webkit-font-smoothing:antialiased; } -*{text-shadow: 0 1px 0 white} body{font-size: 12px; background-color: #eee;} a{text-decoration: none; font-weight: bold; color: #666} a:hover{color: #333} @@ -481,15 +480,58 @@ header .account-links a:last-child{ border-bottom: 0; } -#no_ssh_key_defined { - border:1px solid #ee8801; - margin:20px; - padding:20px; - background:#ffe3f0; - h2{margin:0;} - p {margin:10px 0 0;} +.big-message{ + background-image: -webkit-gradient(linear, 0 48, 0 0, color-stop(0.041, #eccb40), to(#ffee4d)); + background-image: -webkit-linear-gradient(90deg, #eccb40 4.1%, #ffee4d); + background-image: -moz-linear-gradient(90deg, #eccb40 4.1%, #ffee4d); + background-image: -o-linear-gradient(90deg, #eccb40 4.1%, #ffee4d); + text-align: center; + font-weight: bold; + padding: 10px 20px; + text-shadow: 0 1px 0 rgba(255,255,255,.3); + color: #333; + color: rgba(0,0,0,.7); + font-size: 14px; + box-shadow: 0 1px 2px rgba(0,0,0,.7); + z-index: 100000; + margin-bottom: 2px; } +.big-message a{color: #000; text-decoration: underline;} + +.big-message.error{ + background-color: #722523; + background-image: -webkit-gradient(linear, 0 49, 0 0, color-stop(0.04, #722523), to(#ad4846)); + background-image: -webkit-linear-gradient(90deg, #9b403f 4%, #c16765); + background-image: -moz-linear-gradient(90deg, #722523 4%, #ad4846); + background-image: -o-linear-gradient(90deg, #722523 4%, #ad4846); + color: #2E0D0C; +} + +.big-message.success{ + background-color: #7a9339; + background-image: -webkit-gradient(linear, 0 48, 0 0, color-stop(0.062, #7a9339), to(#93ae46)); + background-image: -webkit-linear-gradient(90deg, #7a9339 6.2%, #93ae46); + background-image: -moz-linear-gradient(90deg, #7a9339 6.2%, #93ae46); + background-image: -o-linear-gradient(90deg, #7a9339 6.2%, #93ae46) +} + +.big-message.success{ + background-color: #7a9339; + background-image: -webkit-gradient(linear, 0 48, 0 0, color-stop(0.062, #7a9339), to(#93ae46)); + background-image: -webkit-linear-gradient(90deg, #7a9339 6.2%, #93ae46); + background-image: -moz-linear-gradient(90deg, #7a9339 6.2%, #93ae46); + background-image: -o-linear-gradient(90deg, #7a9339 6.2%, #93ae46) +} + +.big-message.notice{ + background-image: -webkit-gradient(linear, 0 49, 0 0, color-stop(0.061, #447790), color-stop(0.897, #5da2bf)); + background-image: -webkit-linear-gradient(90deg, #447790 6.1%, #5da2bf 89.7%); + background-image: -moz-linear-gradient(90deg, #447790 6.1%, #5da2bf 89.7%); + background-image: -o-linear-gradient(90deg, #447790 6.1%, #5da2bf 89.7%) +} + + /* eo Account Box */ input.search-input{float: left; text-shadow: none; width: 116px; background-image: url('icon-search.png') ; background-repeat: no-repeat; background-position: 10px; border-radius: 100px; border: 1px solid rgba(0,0,0,.7); box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 2px rgba(0,0,0,.4) inset ; background-color: #D2D5DA; background-color: rgba(255,255,255,.5); padding: 5px; padding-left: 26px; margin-top: 4px; margin-right: 10px } input.search-input:focus{ background-color: white; width: 216px;} diff --git a/app/views/layouts/_head_panel.html.erb b/app/views/layouts/_head_panel.html.erb index bf0394b1582..40c7e0a08e4 100644 --- a/app/views/layouts/_head_panel.html.erb +++ b/app/views/layouts/_head_panel.html.erb @@ -48,9 +48,7 @@ <% end %> <% if current_user.keys.all.empty? %> -
-

ATTENTION!

-

No SSH Key is defined. You won't be able to use any Git command! -

Click <%=link_to( 'here', keys_path ) %> to add one! +

+

No SSH Key is defined. You won't be able to use any Git command!. Click <%=link_to( 'here', keys_path ) %> to add one!

<% end %> -- GitLab From 2a874a00dc14b71f2967f137144dd25a14df26c5 Mon Sep 17 00:00:00 2001 From: Ricardo Rauch Date: Thu, 17 Nov 2011 16:49:02 -0300 Subject: [PATCH 3/9] fixing aside on dashboard --- app/assets/stylesheets/style.scss | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/style.scss b/app/assets/stylesheets/style.scss index 771fe48bf38..1f050b9f42b 100644 --- a/app/assets/stylesheets/style.scss +++ b/app/assets/stylesheets/style.scss @@ -531,7 +531,6 @@ header .account-links a:last-child{ background-image: -o-linear-gradient(90deg, #447790 6.1%, #5da2bf 89.7%) } - /* eo Account Box */ input.search-input{float: left; text-shadow: none; width: 116px; background-image: url('icon-search.png') ; background-repeat: no-repeat; background-position: 10px; border-radius: 100px; border: 1px solid rgba(0,0,0,.7); box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 2px rgba(0,0,0,.4) inset ; background-color: #D2D5DA; background-color: rgba(255,255,255,.5); padding: 5px; padding-left: 26px; margin-top: 4px; margin-right: 10px } input.search-input:focus{ background-color: white; width: 216px;} @@ -545,12 +544,14 @@ h2.icon span{background: #E3E5EA url('images.png'); height: 32px; width: 32px; /* Dashboard Page */ html, body { height: 100%; } + + body.dashboard-page h2.icon span{ background-position: 9px -69px; } body.dashboard-page header{margin-bottom: 0} -body.dashboard-page .news-feed{padding-left: 1em; margin-right: 450px; margin-left: 1%} +body.dashboard-page .news-feed{padding-left: 1em; margin-right: 450px; min-height: 600px; margin-left: 1%} body.dashboard-page .dashboard-content{ position: relative; float: left; width: 100%; height: 100%; } body.dashboard-page .news-feed h2{float: left;} -body.dashboard-page aside{ min-height: 700px; width: 420px; float: right; background-color: #f7f7f7; border-left: 1px solid #ccc } +body.dashboard-page aside{ min-height: 700px; position: absolute; top: 0; bottom: 0; right: 0; width: 420px; float: right; background-color: #f7f7f7; border-left: 1px solid #ccc } body.dashboard-page aside h4{margin: 0; border-bottom: 1px solid #ccc; padding: 10px 10px; font-size: 11px; font-weight: bold; text-transform: uppercase;} body.dashboard-page aside h4 a.button-small{float: right; text-transform: none; border-radius: 4px; margin-right: 2%; margin-top: -4px; display: block;} body.dashboard-page aside .project-list {list-style: none; margin: 0; padding: 0;} @@ -592,7 +593,7 @@ body.project-page .page-title{margin-bottom: 0} body.project-page .project-sidebar {width: 220px; left: 0; top: 0; height: 100%; bottom: 0; position: absolute; background-color: #f7f7f7; float: left; display: inline-block; background: #f7f7f7; padding: 20px 0 20px 2%; margin: 0; } body.project-page input.text.git-url, -body.projects-page input.text.git-url { font-size: 12px; border-radius: 5px; color: #666; box-shadow: 0 1px 2px rgba(0,0,0,.2) inset; padding: 8px 14px 8px 30px; margin-bottom: 20px; background: white url('images.png') no-repeat 8px -40px;} +body.projects-page input.text.git-url { font-size: 12px; border-radius: 5px; color: #666; box-shadow: 0 1px 2px rgba(0,0,0,.2) inset; padding: 8px 0 8px 30px; margin-bottom: 20px; background: white url('images.png') no-repeat 8px -40px; width: 176px} body.projects-page input.text.git-url {margin:10px 0 0 } .git_url_wrapper { margin-right:50px } -- GitLab From 26bdeb2107d7d55aa89132d9c060421bd377c9f0 Mon Sep 17 00:00:00 2001 From: Saito Date: Fri, 18 Nov 2011 10:55:08 +0800 Subject: [PATCH 4/9] commit safe_commit --- lib/commit_ext.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/commit_ext.rb b/lib/commit_ext.rb index 91a4c059b02..0e045911843 100644 --- a/lib/commit_ext.rb +++ b/lib/commit_ext.rb @@ -3,13 +3,7 @@ module CommitExt attr_accessor :refs def safe_message - message.encode("UTF-8", - :invalid => :replace, - :undef => :replace, - :universal_newline => true, - :replace => "") - rescue - "-- invalid encoding for commit message" + message.force_encoding(Encoding::UTF_8) end def created_at -- GitLab From 15016ae68dd2e59ce1b12b0be6e9870d16219569 Mon Sep 17 00:00:00 2001 From: Drew Date: Fri, 18 Nov 2011 01:32:22 -0500 Subject: [PATCH 5/9] resolved issue 244 and updated test --- app/models/user.rb | 2 +- spec/models/user_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index f6c271467dd..712c7aecb26 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -30,7 +30,7 @@ class User < ActiveRecord::Base scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) } def identifier - email.gsub "@", "_" + email.gsub /[@.]/, "_" end def is_admin? diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index a22aee75b0d..226365775da 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -16,7 +16,7 @@ describe User do it "should return valid identifier" do user = User.new(:email => "test@mail.com") - user.identifier.should == "test_mail.com" + user.identifier.should == "test_mail_com" end it "should have authentication token" do -- GitLab From 91d5a906f9cd1f120312d1ca72c8e500263c4439 Mon Sep 17 00:00:00 2001 From: Drew Date: Fri, 18 Nov 2011 01:52:13 -0500 Subject: [PATCH 6/9] Resolved issue #235 --- .rvmrc | 56 ++++++++++++++++++++++++++++- app/models/note.rb | 1 + app/views/layouts/project.html.haml | 2 +- spec/models/note_spec.rb | 7 +++- 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/.rvmrc b/.rvmrc index 8ad3b66d530..8af363c4c1f 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1 +1,55 @@ -rvm use 1.9.2-p290 +#!/usr/bin/env bash + +# This is an RVM Project .rvmrc file, used to automatically load the ruby +# development environment upon cd'ing into the directory + +# First we specify our desired [@], the @gemset name is optional. +environment_id="ruby-1.9.2-p290@gitlabhq" + +# +# Uncomment following line if you want options to be set only for given project. +# +# PROJECT_JRUBY_OPTS=( --1.9 ) + +# +# First we attempt to load the desired environment directly from the environment +# file. This is very fast and efficient compared to running through the entire +# CLI and selector. If you want feedback on which environment was used then +# insert the word 'use' after --create as this triggers verbose mode. +# +if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ + && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] +then + \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" + + if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] + then + . "${rvm_path:-$HOME/.rvm}/hooks/after_use" + fi +else + # If the environment file has not yet been created, use the RVM CLI to select. + if ! rvm --create "$environment_id" + then + echo "Failed to create RVM environment '${environment_id}'." + exit 1 + fi +fi + +# +# If you use an RVM gemset file to install a list of gems (*.gems), you can have +# it be automatically loaded. Uncomment the following and adjust the filename if +# necessary. +# +# filename=".gems" +# if [[ -s "$filename" ]] +# then +# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d' +# fi + +# If you use bundler, this might be useful to you: +# if command -v bundle && [[ -s Gemfile ]] +# then +# bundle +# fi + + diff --git a/app/models/note.rb b/app/models/note.rb index 0ec63f8b6a2..946f506264a 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -27,6 +27,7 @@ class Note < ActiveRecord::Base scope :common, where(:noteable_id => nil) + scope :today, where("created_at >= :date", :date => Date.today) scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days)) scope :since, lambda { |day| where("created_at >= :date", :date => (day)) } scope :fresh, order("created_at DESC") diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 6407da10403..b06e75ef698 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -38,7 +38,7 @@ = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do Wall - if @project.common_notes.count > 0 - %span{ :class => "number" }= @project.common_notes.count + %span{ :class => "number" }= @project.common_notes.today.count = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do Snippets - if @project.snippets.count > 0 diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 038e4f9d36e..bd3f3934aec 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -12,7 +12,12 @@ describe Note do it { Factory.create(:note, :project => Factory.create(:project)).should be_valid } - + describe "Scopes" do + it "should have a today named scope that returns ..." do + Note.today.where_values.should == ["created_at >= '#{Date.today}'"] + end + end + describe :authorization do before do @p1 = Factory :project -- GitLab From 139c4c2f181719f61e7b27ba23df6c065d795f2a Mon Sep 17 00:00:00 2001 From: Saito Date: Fri, 18 Nov 2011 19:48:23 +0800 Subject: [PATCH 7/9] fix diff bug --- app/views/commits/_text_file.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index ed9adffd1e0..cb54299a772 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -2,6 +2,7 @@ - line_new = 0 - lines_arr = diff.diff.lines.to_a - lines_arr.each do |line| + - line = line.force_encoding(Encoding::UTF_8) - next if line.match(/^--- \/dev\/null/) - next if line.match(/^--- a/) - next if line.match(/^\+\+\+ b/) -- GitLab From 4281704fb3d93fd641643e0eab1e388254c71f96 Mon Sep 17 00:00:00 2001 From: Saito Date: Fri, 18 Nov 2011 20:16:59 +0800 Subject: [PATCH 8/9] fix diff bug with utf-8 --- app/views/commits/_text_file.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index cb54299a772..bdc740b3952 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -2,7 +2,7 @@ - line_new = 0 - lines_arr = diff.diff.lines.to_a - lines_arr.each do |line| - - line = line.force_encoding(Encoding::UTF_8) + - line.force_encoding(Encoding::UTF_8) - next if line.match(/^--- \/dev\/null/) - next if line.match(/^--- a/) - next if line.match(/^\+\+\+ b/) -- GitLab From c359eadf8eab096ef3193bf901b40b84488ca74d Mon Sep 17 00:00:00 2001 From: Saito Date: Fri, 18 Nov 2011 21:34:36 +0800 Subject: [PATCH 9/9] restore the rvmrc --- .rvmrc | 56 +------------------------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/.rvmrc b/.rvmrc index 8af363c4c1f..8ad3b66d530 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1,55 +1 @@ -#!/usr/bin/env bash - -# This is an RVM Project .rvmrc file, used to automatically load the ruby -# development environment upon cd'ing into the directory - -# First we specify our desired [@], the @gemset name is optional. -environment_id="ruby-1.9.2-p290@gitlabhq" - -# -# Uncomment following line if you want options to be set only for given project. -# -# PROJECT_JRUBY_OPTS=( --1.9 ) - -# -# First we attempt to load the desired environment directly from the environment -# file. This is very fast and efficient compared to running through the entire -# CLI and selector. If you want feedback on which environment was used then -# insert the word 'use' after --create as this triggers verbose mode. -# -if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ - && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] -then - \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" - - if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] - then - . "${rvm_path:-$HOME/.rvm}/hooks/after_use" - fi -else - # If the environment file has not yet been created, use the RVM CLI to select. - if ! rvm --create "$environment_id" - then - echo "Failed to create RVM environment '${environment_id}'." - exit 1 - fi -fi - -# -# If you use an RVM gemset file to install a list of gems (*.gems), you can have -# it be automatically loaded. Uncomment the following and adjust the filename if -# necessary. -# -# filename=".gems" -# if [[ -s "$filename" ]] -# then -# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d' -# fi - -# If you use bundler, this might be useful to you: -# if command -v bundle && [[ -s Gemfile ]] -# then -# bundle -# fi - - +rvm use 1.9.2-p290 -- GitLab