Commit 8f7c7bf6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'rs-remove-stamp' into 'master'

Remove stamp gem

Closes #5908

See merge request !2323
parents e78ddb09 09dbe375
...@@ -67,10 +67,6 @@ gem 'grape', '~> 0.13.0' ...@@ -67,10 +67,6 @@ gem 'grape', '~> 0.13.0'
gem 'grape-entity', '~> 0.4.2' gem 'grape-entity', '~> 0.4.2'
gem 'rack-cors', '~> 0.4.0', require: 'rack/cors' gem 'rack-cors', '~> 0.4.0', require: 'rack/cors'
# Format dates and times
# based on human-friendly examples
gem "stamp", '~> 0.6.0'
# Pagination # Pagination
gem "kaminari", "~> 0.16.3" gem "kaminari", "~> 0.16.3"
......
...@@ -734,7 +734,6 @@ GEM ...@@ -734,7 +734,6 @@ GEM
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0) sprockets (>= 2.8, < 4.0)
stamp (0.6.0)
state_machines (0.4.0) state_machines (0.4.0)
state_machines-activemodel (0.3.0) state_machines-activemodel (0.3.0)
activemodel (~> 4.1) activemodel (~> 4.1)
...@@ -978,7 +977,6 @@ DEPENDENCIES ...@@ -978,7 +977,6 @@ DEPENDENCIES
spring-commands-spinach (~> 1.0.0) spring-commands-spinach (~> 1.0.0)
spring-commands-teaspoon (~> 0.0.2) spring-commands-teaspoon (~> 0.0.2)
sprockets (~> 2.12.3) sprockets (~> 2.12.3)
stamp (~> 0.6.0)
state_machines-activerecord (~> 0.3.0) state_machines-activerecord (~> 0.3.0)
task_list (~> 1.0.2) task_list (~> 1.0.2)
teaspoon (~> 1.0.0) teaspoon (~> 1.0.0)
......
...@@ -206,7 +206,7 @@ module ApplicationHelper ...@@ -206,7 +206,7 @@ module ApplicationHelper
element = content_tag :time, time.to_s, element = content_tag :time, time.to_s,
class: "#{html_class} js-timeago js-timeago-pending", class: "#{html_class} js-timeago js-timeago-pending",
datetime: time.getutc.iso8601, datetime: time.getutc.iso8601,
title: time.in_time_zone.stamp('Aug 21, 2011 9:23pm'), title: time.in_time_zone.to_s(:medium),
data: { toggle: 'tooltip', placement: placement, container: 'body' } data: { toggle: 'tooltip', placement: placement, container: 'body' }
unless skip_js unless skip_js
......
...@@ -80,7 +80,7 @@ module IssuesHelper ...@@ -80,7 +80,7 @@ module IssuesHelper
xml.link href: namespace_project_issue_url(issue.project.namespace, xml.link href: namespace_project_issue_url(issue.project.namespace,
issue.project, issue) issue.project, issue)
xml.title truncate(issue.title, length: 80) xml.title truncate(issue.title, length: 80)
xml.updated issue.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") xml.updated issue.created_at.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(issue.author_email)) xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(issue.author_email))
xml.author do |author| xml.author do |author|
xml.name issue.author_name xml.name issue.author_name
......
...@@ -121,9 +121,9 @@ class GlobalMilestone ...@@ -121,9 +121,9 @@ class GlobalMilestone
def expires_at def expires_at
if due_date if due_date
if due_date.past? if due_date.past?
"expired at #{due_date.stamp("Aug 21, 2011")}" "expired on #{due_date.to_s(:medium)}"
else else
"expires at #{due_date.stamp("Aug 21, 2011")}" "expires on #{due_date.to_s(:medium)}"
end end
end end
end end
......
...@@ -112,9 +112,9 @@ class Milestone < ActiveRecord::Base ...@@ -112,9 +112,9 @@ class Milestone < ActiveRecord::Base
def expires_at def expires_at
if due_date if due_date
if due_date.past? if due_date.past?
"expired at #{due_date.stamp("Aug 21, 2011")}" "expired on #{due_date.to_s(:medium)}"
else else
"expires at #{due_date.stamp("Aug 21, 2011")}" "expires on #{due_date.to_s(:medium)}"
end end
end end
end end
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
%li %li
%span.light Created on: %span.light Created on:
%strong %strong
= @group.created_at.stamp("March 1, 1999") = @group.created_at.to_s(:medium)
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
%li %li
%span.light Created on: %span.light Created on:
%strong %strong
= @project.created_at.stamp("March 1, 1999") = @project.created_at.to_s(:medium)
%li %li
%span.light http: %span.light http:
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%ul.well-list %ul.well-list
%li %li
%span.light Member since %span.light Member since
%strong= user.created_at.stamp("Aug 21, 2011") %strong= user.created_at.to_s(:medium)
- unless user.public_email.blank? - unless user.public_email.blank?
%li %li
%span.light E-mail: %span.light E-mail:
......
...@@ -58,12 +58,12 @@ ...@@ -58,12 +58,12 @@
%li %li
%span.light Member since: %span.light Member since:
%strong %strong
= @user.created_at.stamp("Nov 12, 2031") = @user.created_at.to_s(:medium)
- if @user.confirmed_at - if @user.confirmed_at
%li %li
%span.light Confirmed at: %span.light Confirmed at:
%strong %strong
= @user.confirmed_at.stamp("Nov 12, 2031") = @user.confirmed_at.to_s(:medium)
- else - else
%li %li
%span.light Confirmed: %span.light Confirmed:
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
%span.light Current sign-in at: %span.light Current sign-in at:
%strong %strong
- if @user.current_sign_in_at - if @user.current_sign_in_at
= @user.current_sign_in_at.stamp("Nov 12, 2031") = @user.current_sign_in_at.to_s(:medium)
- else - else
never never
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
%span.light Last sign-in at: %span.light Last sign-in at:
%strong %strong
- if @user.last_sign_in_at - if @user.last_sign_in_at
= @user.last_sign_in_at.stamp("Nov 12, 2031") = @user.last_sign_in_at.to_s(:medium)
- else - else
never never
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: issues_dashboard_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: issues_dashboard_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: issues_dashboard_url, rel: "alternate", type: "text/html" xml.link href: issues_dashboard_url, rel: "alternate", type: "text/html"
xml.id issues_dashboard_url xml.id issues_dashboard_url
xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? xml.updated @issues.first.created_at.xmlschema if @issues.any?
@issues.each do |issue| @issues.each do |issue|
issue_to_atom(xml, issue) issue_to_atom(xml, issue)
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: dashboard_projects_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: dashboard_projects_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: dashboard_projects_url, rel: "alternate", type: "text/html" xml.link href: dashboard_projects_url, rel: "alternate", type: "text/html"
xml.id dashboard_projects_url xml.id dashboard_projects_url
xml.updated @events.latest_update_time.strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? xml.updated @events.latest_update_time.xmlschema if @events.any?
@events.each do |event| @events.each do |event|
event_to_atom(xml, event) event_to_atom(xml, event)
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: issues_dashboard_url(format: :atom, private_token: @user.private_token), rel: "self", type: "application/atom+xml" xml.link href: issues_dashboard_url(format: :atom, private_token: @user.private_token), rel: "self", type: "application/atom+xml"
xml.link href: issues_dashboard_url, rel: "alternate", type: "text/html" xml.link href: issues_dashboard_url, rel: "alternate", type: "text/html"
xml.id issues_dashboard_url xml.id issues_dashboard_url
xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? xml.updated @issues.first.created_at.xmlschema if @issues.any?
@issues.each do |issue| @issues.each do |issue|
issue_to_atom(xml, issue) issue_to_atom(xml, issue)
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: group_url(@group, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: group_url(@group, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: group_url(@group), rel: "alternate", type: "text/html" xml.link href: group_url(@group), rel: "alternate", type: "text/html"
xml.id group_url(@group) xml.id group_url(@group)
xml.updated @events.latest_update_time.strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? xml.updated @events.latest_update_time.xmlschema if @events.any?
@events.each do |event| @events.each do |event|
event_to_atom(xml, event) event_to_atom(xml, event)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
%strong #{link_to(commit.short_id, namespace_project_commit_url(@message.project_namespace, @message.project, commit))} %strong #{link_to(commit.short_id, namespace_project_commit_url(@message.project_namespace, @message.project, commit))}
%div %div
%span by #{commit.author_name} %span by #{commit.author_name}
%i at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")} %i at #{commit.committed_date.to_s(:iso8601)}
%pre.commit-message %pre.commit-message
= commit.safe_message = commit.safe_message
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
\ \
= @message.reverse_compare? ? "Deleted commits:" : "Commits:" = @message.reverse_compare? ? "Deleted commits:" : "Commits:"
- @message.commits.each do |commit| - @message.commits.each do |commit|
#{commit.short_id} by #{commit.author_name} at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")} #{commit.short_id} by #{commit.author_name} at #{commit.committed_date.to_s(:iso8601)}
#{commit.safe_message} #{commit.safe_message}
\- - - - - \- - - - -
\ \
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%strong= @key.title %strong= @key.title
%li %li
%span.light Created on: %span.light Created on:
%strong= @key.created_at.stamp("Aug 21, 2011") %strong= @key.created_at.to_s(:medium)
.col-md-8 .col-md-8
%p %p
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
.col-md-2.hidden-xs.hidden-sm .col-md-2.hidden-xs.hidden-sm
%h5.commits-row-date %h5.commits-row-date
%i.fa.fa-calendar %i.fa.fa-calendar
%span= day.stamp("28 Aug, 2010") %span= day.strftime('%d %b, %Y')
.light .light
= pluralize(commits.count, 'commit') = pluralize(commits.count, 'commit')
.col-md-10.col-sm-12 .col-md-10.col-sm-12
......
...@@ -4,14 +4,14 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,14 +4,14 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: namespace_project_commits_url(@project.namespace, @project, @ref), rel: "alternate", type: "text/html" xml.link href: namespace_project_commits_url(@project.namespace, @project, @ref), rel: "alternate", type: "text/html"
xml.id namespace_project_commits_url(@project.namespace, @project, @ref) xml.id namespace_project_commits_url(@project.namespace, @project, @ref)
xml.updated @commits.first.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") if @commits.any? xml.updated @commits.first.committed_date.xmlschema if @commits.any?
@commits.each do |commit| @commits.each do |commit|
xml.entry do xml.entry do
xml.id namespace_project_commit_url(@project.namespace, @project, id: commit.id) xml.id namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.link href: namespace_project_commit_url(@project.namespace, @project, id: commit.id) xml.link href: namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.title truncate(commit.title, length: 80) xml.title truncate(commit.title, length: 80)
xml.updated commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") xml.updated commit.committed_date.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email)) xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email))
xml.author do |author| xml.author do |author|
xml.name commit.author_name xml.name commit.author_name
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: namespace_project_issues_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: namespace_project_issues_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: namespace_project_issues_url(@project.namespace, @project), rel: "alternate", type: "text/html" xml.link href: namespace_project_issues_url(@project.namespace, @project), rel: "alternate", type: "text/html"
xml.id namespace_project_issues_url(@project.namespace, @project) xml.id namespace_project_issues_url(@project.namespace, @project)
xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? xml.updated @issues.first.created_at.xmlschema if @issues.any?
@issues.each do |issue| @issues.each do |issue|
issue_to_atom(xml, issue) issue_to_atom(xml, issue)
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: namespace_project_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: namespace_project_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html" xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html"
xml.id namespace_project_url(@project.namespace, @project) xml.id namespace_project_url(@project.namespace, @project)
xml.updated @events.latest_update_time.strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? xml.updated @events.latest_update_time.xmlschema if @events.any?
@events.each do |event| @events.each do |event|
event_to_atom(xml, event) event_to_atom(xml, event)
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: user_url(@user, :atom), rel: "self", type: "application/atom+xml" xml.link href: user_url(@user, :atom), rel: "self", type: "application/atom+xml"
xml.link href: user_url(@user), rel: "alternate", type: "text/html" xml.link href: user_url(@user), rel: "alternate", type: "text/html"
xml.id user_url(@user) xml.id user_url(@user)
xml.updated @events.latest_update_time.strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? xml.updated @events.latest_update_time.xmlschema if @events.any?
@events.each do |event| @events.each do |event|
event_to_atom(xml, event) event_to_atom(xml, event)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
%span %span
#{@user.bio}. #{@user.bio}.
%span %span
Member since #{@user.created_at.stamp("Aug 21, 2011")} Member since #{@user.created_at.to_s(:medium)}
.cover-desc .cover-desc
- unless @user.public_email.blank? - unless @user.public_email.blank?
......
# :short - 10 Nov
# :medium - Nov 10, 2007
# :long - November 10, 2007
Date::DATE_FORMATS[:medium] = '%b %-d, %Y'
# :short - 18 Jan 06:10
# :medium - Jan 18, 2007 6:10am
# :long - January 18, 2007 06:10
Time::DATE_FORMATS[:medium] = '%b %-d, %Y %-I:%M%P'
...@@ -28,7 +28,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps ...@@ -28,7 +28,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
end end
step 'I should see group milestone with descriptions and expiry date' do step 'I should see group milestone with descriptions and expiry date' do
expect(page).to have_content('expires at Aug 20, 2114') expect(page).to have_content('expires on Aug 20, 2114')
end end
step 'I should see group milestone with all issues and MRs assigned to that milestone' do step 'I should see group milestone with all issues and MRs assigned to that milestone' do
......
...@@ -240,7 +240,7 @@ describe ApplicationHelper do ...@@ -240,7 +240,7 @@ describe ApplicationHelper do
describe 'time_ago_with_tooltip' do describe 'time_ago_with_tooltip' do
def element(*arguments) def element(*arguments)
Time.zone = 'UTC' Time.zone = 'UTC'
time = Time.zone.parse('2015-07-02 08:00') time = Time.zone.parse('2015-07-02 08:23')
element = helper.time_ago_with_tooltip(time, *arguments) element = helper.time_ago_with_tooltip(time, *arguments)
Nokogiri::HTML::DocumentFragment.parse(element).first_element_child Nokogiri::HTML::DocumentFragment.parse(element).first_element_child
...@@ -251,15 +251,15 @@ describe ApplicationHelper do ...@@ -251,15 +251,15 @@ describe ApplicationHelper do
end end
it 'includes the date string' do it 'includes the date string' do
expect(element.text).to eq '2015-07-02 08:00:00 UTC' expect(element.text).to eq '2015-07-02 08:23:00 UTC'
end end
it 'has a datetime attribute' do it 'has a datetime attribute' do
expect(element.attr('datetime')).to eq '2015-07-02T08:00:00Z' expect(element.attr('datetime')).to eq '2015-07-02T08:23:00Z'
end end
it 'has a formatted title attribute' do it 'has a formatted title attribute' do
expect(element.attr('title')).to eq 'Jul 02, 2015 8:00am' expect(element.attr('title')).to eq 'Jul 2, 2015 8:23am'
end end
it 'includes a default js-timeago class' do it 'includes a default js-timeago class' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment