Module: Zubat::GitCommandWrapper::Stub

Defined in:
lib/zubat/git_command_wrapper.rb

Instance Method Summary collapse

Instance Method Details

#diff(sha:, file:) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



40
41
42
43
44
45
46
47
48
49
# File 'lib/zubat/git_command_wrapper.rb', line 40

def diff(sha:, file:) # rubocop:disable Lint/UnusedMethodArgument
  <<~SCRIPT
    diff --git a/hello_world.rb b/hello_world.rb
      class HelloWorld
        def show
    +      puts "Hello World"
        end
      end
  SCRIPT
end

#exists?(sha:, file:) ⇒ Boolean

rubocop:disable Lint/UnusedMethodArgument

Returns:

  • (Boolean)


26
27
28
# File 'lib/zubat/git_command_wrapper.rb', line 26

def exists?(sha:, file:) # rubocop:disable Lint/UnusedMethodArgument
  true
end

#log(files:) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/zubat/git_command_wrapper.rb', line 14

def log(files:)
  logs = files.map do
    Log.new(sha: SecureRandom.hex(3), time: Time.at(rand(1_900_000_000..1_900_999_999)))
  end

  logs.sort_by!(&:time)

  logs.reverse!

  logs
end

#remote_origin_urlObject



10
11
12
# File 'lib/zubat/git_command_wrapper.rb', line 10

def remote_origin_url
  "https://github.com/mizoR/zubat.git"
end

#show(sha:, file:) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



30
31
32
33
34
35
36
37
38
# File 'lib/zubat/git_command_wrapper.rb', line 30

def show(sha:, file:) # rubocop:disable Lint/UnusedMethodArgument
  <<~SCRIPT
    class HelloWorld
      def show
        puts "Hello World"
      end
    end
  SCRIPT
end