Module: Gitdocs

Defined in:
lib/gitdocs/cli.rb,
lib/gitdocs.rb,
lib/gitdocs/share.rb,
lib/gitdocs/search.rb,
lib/gitdocs/manager.rb,
lib/gitdocs/version.rb,
lib/gitdocs/notifier.rb,
lib/gitdocs/repository.rb,
lib/gitdocs/browser_app.rb,
lib/gitdocs/initializer.rb,
lib/gitdocs/git_notifier.rb,
lib/gitdocs/settings_app.rb,
lib/gitdocs/synchronizer.rb,
lib/gitdocs/configuration.rb,
lib/gitdocs/repository/path.rb,
lib/gitdocs/rendering_helper.rb,
lib/gitdocs/repository/committer.rb

Overview

Class for executing File and Git operations on a specific path in the repository.

Defined Under Namespace

Modules: RenderingHelper Classes: BrowserApp, Cli, Configuration, GitNotifier, Initializer, Manager, Notifier, Repository, Search, SettingsApp, Share, Synchronizer

Constant Summary collapse

Restart =
Class.new(RuntimeError)
VERSION =
'0.6.2'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#notificationBoolean

Returns default to true.

Returns:

  • (Boolean)

    default to true



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gitdocs/configuration.rb', line 17

module Gitdocs
  class Configuration
    # @return [Boolean]
    def self.start_web_frontend
      Config.global.start_web_frontend
    end

    # @return [Integer]
    def self.web_frontend_port
      Config.global.web_frontend_port
    end

    # @param [Hash] new_config
    def self.update(new_config)
      Config.global.update_attributes(new_config)
    end

    # NOTE: This record has been kept as a subclass to avoid changing the
    # database table. There are other ways to achieve this, but this seemed most
    # clear for now. [2015-06-26 -- acant]
    #
    # @!attribute start_frontend_port
    #   @return [Boolean] defaults to true
    # @!attribute web_frontend_port
    #   @return [Integer] defaults to 8888
    class Config < ActiveRecord::Base
      # @return [Gitdocs::Configuration::Config]
      def self.global
        fail if all.size > 1
        create! if all.empty?
        all.first
      end
    end
  end
end

#pathString

Returns:

  • (String)


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gitdocs/configuration.rb', line 17

module Gitdocs
  class Configuration
    # @return [Boolean]
    def self.start_web_frontend
      Config.global.start_web_frontend
    end

    # @return [Integer]
    def self.web_frontend_port
      Config.global.web_frontend_port
    end

    # @param [Hash] new_config
    def self.update(new_config)
      Config.global.update_attributes(new_config)
    end

    # NOTE: This record has been kept as a subclass to avoid changing the
    # database table. There are other ways to achieve this, but this seemed most
    # clear for now. [2015-06-26 -- acant]
    #
    # @!attribute start_frontend_port
    #   @return [Boolean] defaults to true
    # @!attribute web_frontend_port
    #   @return [Integer] defaults to 8888
    class Config < ActiveRecord::Base
      # @return [Gitdocs::Configuration::Config]
      def self.global
        fail if all.size > 1
        create! if all.empty?
        all.first
      end
    end
  end
end

#polling_intervalDouble

Returns defaults to 15.0.

Returns:

  • (Double)

    defaults to 15.0



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gitdocs/configuration.rb', line 17

module Gitdocs
  class Configuration
    # @return [Boolean]
    def self.start_web_frontend
      Config.global.start_web_frontend
    end

    # @return [Integer]
    def self.web_frontend_port
      Config.global.web_frontend_port
    end

    # @param [Hash] new_config
    def self.update(new_config)
      Config.global.update_attributes(new_config)
    end

    # NOTE: This record has been kept as a subclass to avoid changing the
    # database table. There are other ways to achieve this, but this seemed most
    # clear for now. [2015-06-26 -- acant]
    #
    # @!attribute start_frontend_port
    #   @return [Boolean] defaults to true
    # @!attribute web_frontend_port
    #   @return [Integer] defaults to 8888
    class Config < ActiveRecord::Base
      # @return [Gitdocs::Configuration::Config]
      def self.global
        fail if all.size > 1
        create! if all.empty?
        all.first
      end
    end
  end
end

#remote_branchString

Returns default to ‘master’.

Returns:

  • (String)

    default to ‘master’



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gitdocs/configuration.rb', line 17

module Gitdocs
  class Configuration
    # @return [Boolean]
    def self.start_web_frontend
      Config.global.start_web_frontend
    end

    # @return [Integer]
    def self.web_frontend_port
      Config.global.web_frontend_port
    end

    # @param [Hash] new_config
    def self.update(new_config)
      Config.global.update_attributes(new_config)
    end

    # NOTE: This record has been kept as a subclass to avoid changing the
    # database table. There are other ways to achieve this, but this seemed most
    # clear for now. [2015-06-26 -- acant]
    #
    # @!attribute start_frontend_port
    #   @return [Boolean] defaults to true
    # @!attribute web_frontend_port
    #   @return [Integer] defaults to 8888
    class Config < ActiveRecord::Base
      # @return [Gitdocs::Configuration::Config]
      def self.global
        fail if all.size > 1
        create! if all.empty?
        all.first
      end
    end
  end
end

#remote_nameString

Returns default to ‘origin’.

Returns:

  • (String)

    default to ‘origin’



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gitdocs/configuration.rb', line 17

module Gitdocs
  class Configuration
    # @return [Boolean]
    def self.start_web_frontend
      Config.global.start_web_frontend
    end

    # @return [Integer]
    def self.web_frontend_port
      Config.global.web_frontend_port
    end

    # @param [Hash] new_config
    def self.update(new_config)
      Config.global.update_attributes(new_config)
    end

    # NOTE: This record has been kept as a subclass to avoid changing the
    # database table. There are other ways to achieve this, but this seemed most
    # clear for now. [2015-06-26 -- acant]
    #
    # @!attribute start_frontend_port
    #   @return [Boolean] defaults to true
    # @!attribute web_frontend_port
    #   @return [Integer] defaults to 8888
    class Config < ActiveRecord::Base
      # @return [Gitdocs::Configuration::Config]
      def self.global
        fail if all.size > 1
        create! if all.empty?
        all.first
      end
    end
  end
end

#sync_type'full', 'fetch'

Returns:

  • ('full', 'fetch')


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gitdocs/configuration.rb', line 17

module Gitdocs
  class Configuration
    # @return [Boolean]
    def self.start_web_frontend
      Config.global.start_web_frontend
    end

    # @return [Integer]
    def self.web_frontend_port
      Config.global.web_frontend_port
    end

    # @param [Hash] new_config
    def self.update(new_config)
      Config.global.update_attributes(new_config)
    end

    # NOTE: This record has been kept as a subclass to avoid changing the
    # database table. There are other ways to achieve this, but this seemed most
    # clear for now. [2015-06-26 -- acant]
    #
    # @!attribute start_frontend_port
    #   @return [Boolean] defaults to true
    # @!attribute web_frontend_port
    #   @return [Integer] defaults to 8888
    class Config < ActiveRecord::Base
      # @return [Gitdocs::Configuration::Config]
      def self.global
        fail if all.size > 1
        create! if all.empty?
        all.first
      end
    end
  end
end

Class Method Details

.init_logvoid

This method returns an undefined value.



70
71
72
73
74
75
76
77
78
# File 'lib/gitdocs.rb', line 70

def self.init_log
  return if @initialized

  # Initialize the logger
  log_output = Initializer.foreground ? STDOUT : log_path
  Celluloid.logger = Logger.new(log_output)
  Celluloid.logger.level = Initializer.verbose ? Logger::DEBUG : Logger::INFO
  @initialized = true
end

.log_debug(message) ⇒ void

This method returns an undefined value.

Parameters:

  • message (String)


39
40
41
42
# File 'lib/gitdocs.rb', line 39

def self.log_debug(message)
  init_log
  Celluloid.logger.debug(message)
end

.log_error(message) ⇒ void

This method returns an undefined value.

Parameters:

  • message (String)


60
61
62
63
# File 'lib/gitdocs.rb', line 60

def self.log_error(message)
  init_log
  Celluloid.logger.error(message)
end

.log_info(message) ⇒ void

This method returns an undefined value.

Parameters:

  • message (String)


46
47
48
49
# File 'lib/gitdocs.rb', line 46

def self.log_info(message)
  init_log
  Celluloid.logger.info(message)
end

.log_pathString

Returns:

  • (String)


33
34
35
# File 'lib/gitdocs.rb', line 33

def self.log_path
  File.expand_path('log', Initializer.root_dirname)
end

.log_warn(message) ⇒ void

This method returns an undefined value.

Parameters:

  • message (String)


53
54
55
56
# File 'lib/gitdocs.rb', line 53

def self.log_warn(message)
  init_log
  Celluloid.logger.warn(message)
end