Module: RubyPocket

Defined in:
lib/ruby_pocket.rb,
lib/ruby_pocket/cli.rb,
lib/ruby_pocket/tag.rb,
lib/ruby_pocket/version.rb,
lib/ruby_pocket/favorite.rb,
lib/ruby_pocket/web_page.rb,
lib/ruby_pocket/cli/options.rb,
lib/ruby_pocket/environment.rb,
lib/ruby_pocket/cli/add_action.rb,
lib/ruby_pocket/favorite_query.rb,
lib/ruby_pocket/cli/list_action.rb,
lib/ruby_pocket/cli/open_action.rb,
lib/ruby_pocket/favorite_creator.rb,
lib/ruby_pocket/cli/delete_action.rb

Defined Under Namespace

Modules: Cli Classes: Environment, Favorite, FavoriteCreator, FavoriteQuery, Tag, WebPage

Constant Summary collapse

RubyPocketError =
Class.new StandardError
VERSION =
'0.1.3'
HttpError =
Class.new RubyPocketError
ValidationError =
Class.new RubyPocketError

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.environmentObject

Returns the value of attribute environment.



9
10
11
# File 'lib/ruby_pocket.rb', line 9

def environment
  @environment
end

Class Method Details

.data_dirObject



27
28
29
# File 'lib/ruby_pocket.rb', line 27

def data_dir
  @data_dir ||= File.join(home_dir, '.ruby_pocket')
end

.setup_data_dirObject



20
21
22
23
24
25
# File 'lib/ruby_pocket.rb', line 20

def setup_data_dir
  return unless environment.production?
  return if Dir.exist?(data_dir)

  Dir.mkdir data_dir
end