utf8 encoding in every file

This commit is contained in:
Tomasz Gieniusz 2012-10-23 20:37:42 +02:00
parent 8f62957ae5
commit 5b3b15f238
46 changed files with 85 additions and 38 deletions

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
end
@ -11,4 +12,4 @@ require 'lazy_high_charts'
require 'launchy'
require 'i18n'
require 'git_stats/base'
require 'git_stats/base'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'git_stats/core_extensions/hash'
require 'git_stats/core_extensions/string'
require 'git_stats/core_extensions/symbol'

View File

@ -1,6 +1,7 @@
# -*- encoding : utf-8 -*-
module ByFieldFinder
def method_missing(name, *args, &block)
field = name[/^by_(.*)$/, 1]
field ? find { |e| e.send(field) == args.first } : super
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require "git_stats"
class GitStats::CLI

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Hash
def to_key_indexed_array(params = {})
raise ArgumentError.new('all the keys must be numbers to convert to key indexed array') unless all? { |k, v| k.is_a? Numeric }
@ -5,4 +6,4 @@ class Hash
default = params[:default]
inject(Array.new(min_size, default)) { |acc, (k, v)| acc[k] = v; acc }.map { |e| e || default }
end
end
end

View File

@ -1,5 +1,6 @@
# -*- encoding : utf-8 -*-
class String
def absolute_path
Pathname.new(__FILE__).expand_path.join(self).cleanpath.to_s
end
end
end

View File

@ -1,5 +1,6 @@
# -*- encoding : utf-8 -*-
class Symbol
def t
I18n.t self
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
class Generator
delegate :add_command_observer, to: :@repo
@ -28,4 +29,4 @@ module GitStats
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module GitData
class Activity
@ -74,4 +75,4 @@ module GitStats
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'git_stats/hash_initializable'
module GitStats
@ -63,4 +64,4 @@ module GitStats
end
end
end
end

View File

@ -1,3 +1,5 @@
# -*- encoding : utf-8 -*-
require 'git_stats/hash_initializable'
module GitStats
@ -33,4 +35,4 @@ module GitStats
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module GitData
class CommandParser
@ -29,4 +30,4 @@ module GitStats
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module GitData
class CommandRunner
@ -6,4 +7,4 @@ module GitStats
end
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'git_stats/hash_initializable'
module GitStats
@ -59,4 +60,4 @@ module GitStats
end
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'git_stats/hash_initializable'
module GitStats
@ -133,4 +134,4 @@ module GitStats
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module GitData
class ShortStat
@ -29,4 +30,4 @@ module GitStats
end
end
end
end
end

View File

@ -1,6 +1,7 @@
# -*- encoding : utf-8 -*-
module HashInitializable
def initialize(params = {})
raise "pass a Hash to initialize #{self.class}" unless params.is_a? Hash
params.each { |k, v| instance_variable_set("@#{k}", v) }
end
end
end

View File

@ -1 +1,2 @@
I18n.load_path += Dir['../../../../config/locales/*.yml'.absolute_path]
# -*- encoding : utf-8 -*-
I18n.load_path += Dir['../../../../config/locales/*.yml'.absolute_path]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module StatsView
module Charts

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module StatsView
module Charts

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module StatsView
module Charts

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module StatsView
module Charts
@ -31,4 +32,4 @@ module GitStats
end
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module StatsView
module Charts

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module StatsView
class Template
@ -16,4 +17,4 @@ module GitStats
end
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module StatsView
class View
@ -68,4 +69,4 @@ module GitStats
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
module StatsView
class ViewData
@ -27,4 +28,4 @@ module GitStats
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitStats
VERSION = "0.0.1"
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe ByFieldFinder do
@ -21,4 +22,4 @@ describe ByFieldFinder do
it 'should throw exception if elements doesnt respond to given field' do
expect { sut.by_non_existing_field }.to raise_error
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
FactoryGirl.define do
initialize_with { new(attributes) }
@ -21,4 +22,4 @@ FactoryGirl.define do
association :repo, strategy: :build
association :author, strategy: :build
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::GitData::Activity do
@ -34,4 +35,4 @@ describe GitStats::GitData::Activity do
it 'by_year_month should count commits by day of year and by month' do
activity.by_year_month.should == {2011 => {6 => 1, 9 => 1}, 2012 => {5 => 3}}
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::GitData::Author do
@ -21,4 +22,4 @@ describe GitStats::GitData::Author do
author.deletions.should == 100
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::GitData::Blob do
@ -21,4 +22,4 @@ describe GitStats::GitData::Blob do
png_blob.should be_binary
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::CLI do
@ -16,4 +17,4 @@ describe GitStats::CLI do
expect { subject.start("only one argument") }.to raise_error
expect { subject.start("too", "much", "arguments") }.to raise_error
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::GitData::Repo do
@ -31,4 +32,4 @@ describe GitStats::GitData::Repo do
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::GitData::Repo do
@ -43,4 +44,4 @@ describe GitStats::GitData::Repo do
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::GitData::Commit do
@ -44,4 +45,4 @@ describe GitStats::GitData::Commit do
end
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::Generator do
@ -42,4 +43,4 @@ describe GitStats::Generator do
generator.render_all
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::GitData::Repo do
@ -42,4 +43,4 @@ ce34874|1347482927|2012-09-12 22:48:47 +0200|joe.doe@gmail.com
repo.project_version.should == 'xyz'
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe GitStats::GitData::ShortStat do
@ -24,4 +25,4 @@ describe GitStats::GitData::ShortStat do
end
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe Hash do
@ -22,4 +23,4 @@ describe Hash do
end
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'integration/shared'
describe GitStats::GitData::Activity do
@ -29,4 +30,4 @@ describe GitStats::GitData::Activity do
activity.by_year_month.should == {2012 => {10 => 10}}
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'integration/shared'
describe GitStats::GitData::Activity do
@ -63,4 +64,4 @@ describe GitStats::GitData::Activity do
jd.deletions_by_date.map { |d, s| s }.should == [0, 0]
end
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'integration/shared'
describe GitStats::GitData::Repo do
@ -27,4 +28,4 @@ test
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'integration/shared'
describe GitStats::GitData::Repo do
@ -64,4 +65,4 @@ describe GitStats::GitData::Repo do
repo.deletions_by_author.values.should == [10, 0]
end
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
shared_context "shared" do
@ -33,4 +34,4 @@ shared_context "shared" do
build(:author, repo: repo, name: "Tomasz Gieniusz", email: "tomasz.gieniusz@gmail.com"),
build(:author, repo: repo, name: "John Doe", email: "john.doe@gmail.com"),
] }
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'simplecov'
SimpleCov.start