code_metrics 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDgwNzdmNmIwNzczZDg1M2VlOWIzNDAzYTliMDYyZTQ0NjgxNmY2Zg==
5
+ data.tar.gz: !binary |-
6
+ ZTViMjFlM2YxZjc2NmIxZGM1MTBjZDFmZTU0ZjQzYWUyMTUyMTU4Zg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MjRhMjRhMGZmOTU5ZWQ3Mjc3Y2ZkMmJlMTU1YzRmZDQyZTIwNWVkMTQzY2U0
10
+ OTc5OTg1Yzk5NGYyOWRlNjljNjA0MWUwZWMxMmY5NDdlYzU3ZTU4OWNlZTM4
11
+ M2UyYTkwMGRkMDU0Yzg5Njc3OWM1MzdkYzcxYzE2NzFlODkxMWE=
12
+ data.tar.gz: !binary |-
13
+ YWUzNjZhYjc3NDllOTMxMGE2MGFmZTQ1NjIwNWMwMjVkOWY4NDQ1ZDNhZjg1
14
+ MDJhYzk5M2VjNmQ0MTY3OWM2OTRlZmJhNjg5ZDUxNDBlZTYzZTMyODNhMDA3
15
+ NjRjYzI2MmQ5MmIwYTEwZjU1NWNkYWRmNmM2NDA3NDkyYzNiOTg=
@@ -40,7 +40,9 @@ module CodeMetrics
40
40
  end
41
41
 
42
42
  def add_by_file_path(file_path)
43
- File.open(file_path) do |f|
43
+ file_flags = 'r:UTF-8'
44
+ file_flags << ':UTF-8' unless defined?(Encoding) && Encoding.default_internal == Encoding::UTF_8
45
+ File.open(file_path, file_flags) do |f|
44
46
  self.add_by_io(f, file_type(file_path))
45
47
  end
46
48
  end
@@ -51,6 +53,7 @@ module CodeMetrics
51
53
  comment_started = false
52
54
 
53
55
  while line = io.gets
56
+ line.encode!('UTF-8', 'UTF-8', :invalid => :replace) if line.respond_to?(:encode!)
54
57
  @lines += 1
55
58
 
56
59
  if comment_started
@@ -1,3 +1,3 @@
1
1
  module CodeMetrics
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,20 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - David Heinemeier Hansson
8
+ - Benjamin Fleischer
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-14 00:00:00.000000000 Z
12
+ date: 2013-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
17
  requirements:
19
18
  - - ! '>'
20
19
  - !ruby/object:Gem::Version
@@ -25,7 +24,6 @@ dependencies:
25
24
  type: :development
26
25
  prerelease: false
27
26
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
27
  requirements:
30
28
  - - ! '>'
31
29
  - !ruby/object:Gem::Version
@@ -35,7 +33,9 @@ dependencies:
35
33
  version: '5.0'
36
34
  description: rake stats is great for looking at statistics on your code, displaying
37
35
  things like KLOCs (thousands of lines of code) and your code to test ratio.
38
- email: david@loudthinking.com
36
+ email:
37
+ - david@loudthinking.com
38
+ - github@benjaminfleischer.com
39
39
  executables:
40
40
  - code_metrics
41
41
  - code_metrics-profile
@@ -95,27 +95,26 @@ files:
95
95
  homepage: https://github.com/bf4/code_metrics
96
96
  licenses:
97
97
  - MIT
98
+ metadata: {}
98
99
  post_install_message:
99
100
  rdoc_options: []
100
101
  require_paths:
101
102
  - lib
102
103
  required_ruby_version: !ruby/object:Gem::Requirement
103
- none: false
104
104
  requirements:
105
105
  - - ! '>='
106
106
  - !ruby/object:Gem::Version
107
- version: 1.9.3
107
+ version: 1.9.0
108
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
- none: false
110
109
  requirements:
111
110
  - - ! '>='
112
111
  - !ruby/object:Gem::Version
113
- version: 1.8.11
112
+ version: 1.3.7
114
113
  requirements: []
115
114
  rubyforge_project:
116
- rubygems_version: 1.8.25
115
+ rubygems_version: 2.0.8
117
116
  signing_key:
118
- specification_version: 3
117
+ specification_version: 4
119
118
  summary: Extraction of the rails rake stats task as a gem and rails plugin
120
119
  test_files:
121
120
  - test/code_metrics_test.rb