Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: coreyti/critique
base: 991f55db19
...
head fork: coreyti/critique
compare: f5c1dc4c05
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 1 addition and 84 deletions.
  1. +1 −1  lib/critique/version.rb
  2. +0 −83 spec/process.rb
View
2  lib/critique/version.rb
@@ -1,3 +1,3 @@
module Critique
- VERSION = "0.1.1"
+ VERSION = "0.1.2"
end
View
83 spec/process.rb
@@ -1,83 +0,0 @@
-require 'profiling'
-
-unless ARGV.size == 2
- puts "usage: ruby process.rb <filename.ext> <config>"
- puts " e.g.,"
- puts " ruby process.rb video.mov all"
- puts " ruby process.rb video.mov 8k"
- puts " ruby process.rb video.mov 10m"
-end
-
-filename = ARGV[0]
-config = ARGV[1]
-
-unless filename && File.exists?(filename)
- puts "\n\nfile does not exist."
- exit 1
-end
-
-class Processor
- extend Profiling
- include Profiling
-
- attr_reader :path, :size
-
- def initialize(path)
- @path = path
- @size = File.size(path)
- end
-
- def read_all
- heading(:all)
-
- profile do |p|
- File.read(path) # NOTE: doing nothing with it
- end
- end
-
- def read_bytes(num)
- bytes = num.to_i
- bytes = (bytes * 1024) if num =~ /.*k$/i
- bytes = (bytes * 1024 * 1024) if num =~ /.*m$/i
-
- heading(:part, bytes)
-
- profile do |p|
- offset = 0
- length = bytes
-
- while offset < size
- remain = size - offset
- amount = (remain < length) ? remain : length
-
- $stdout.print '.' # TODO: move to Profiling
- $stdout.flush
-
- File.read(path, amount, offset) # NOTE: doing nothing with it
- offset += amount
- end
-
- $stdout.puts
- end
- end
-
- def heading(mode, length = nil)
- puts [' ', ('-' * 76)].join
- puts " process.rb... reading #{size} bytes (#{[mode, length].compact.join(' ')})"
- puts [' ', ('-' * 76)].join
- end
-
- # def self.cls_method
- # profile do |p|
- # # p.info("method body")
- # "return value"
- # end
- # end
-end
-
-if config == 'all'
- Processor.new(filename).read_all
-else
- Processor.new(filename).read_bytes(config)
-end
-# Processor.cls_method

No commit comments for this range

Something went wrong with that request. Please try again.