Class: HeyDan::HelpText

Inherits:
Object
  • Object
show all
Defined in:
lib/heydan/help_text.rb

Class Method Summary collapse

Class Method Details

.build(opts = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/heydan/help_text.rb', line 20

def build(opts={})
  return if !HeyDan.help?
  type = opts[:type] || 'all'
  puts %Q(
    Woot, building files for type #{type} jurisdictions/. You will see a progress bar below. If you didn't specify a type, it might take a while. 

    heydan uses the Open Civic Identifiers format to structure file names and main identification for jurisdictions. This helps create a unique nonchanging identification code for every jurisdiction, based on the sponsoring parent. So, the State of Kansas, would be country:us/state:kansas. heydan creates a flat json file for each jurisdiction, which you can then import into your own application or elasticsearch.

    Next, run heydan sources sync
    )
end

.build_identifier(identifier) ⇒ Object



71
72
73
74
# File 'lib/heydan/help_text.rb', line 71

def build_identifier(identifier)
  return if !HeyDan.help?
  puts %Q("building identifiers hash for #{identifier} to filenames, this might take a moment")
end

.git_clone(name) ⇒ Object



61
62
63
64
# File 'lib/heydan/help_text.rb', line 61

def git_clone(name)
  return if !HeyDan.help?
  puts %Q(Cloning #{name} into #{HeyDan.folders[:sources]})
end

.git_update(name) ⇒ Object



66
67
68
69
# File 'lib/heydan/help_text.rb', line 66

def git_update(name)
  return if !HeyDan.help?
  puts %Q(Updating #{name} in #{HeyDan.folders[:sources]})
end

.importObject



76
77
78
79
# File 'lib/heydan/help_text.rb', line 76

def import
  return if !HeyDan.help?
  puts "This will import all the files/contents from the jurisdictions folder into ElasticSearch. Make sure it's running!"
end

.setup(opts = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/heydan/help_text.rb', line 3

def setup(opts={}) 
    return if !HeyDan.help?
    puts %Q(
        Hi! Adding a jurisdictions, datasets, downloads and sources directory and a settings.yml file. If you want to move these directories to other places, just update their locations in the settings file. 

        If you want to run heydan from a different folder than the settings.yml, create an environment variable:

        export HEYDAN_SETTINGS = full/path/to/settings.yml

        To turn off this help, run 'heydan help off' or set the help in settings to false.

        heydan grabs datasets and information about jurisdictions. If you want to focus on just one type of jurisdiction, update the settings 'jurisdiction_type'. Or you can pass --type school_district to any heydan command.

        Next, run `heydan build` to setup your files.
    )
end

.sources_addObject



32
33
34
35
36
37
38
39
# File 'lib/heydan/help_text.rb', line 32

def sources_add
  return if !HeyDan.help?
  puts %Q(
    You can leverage the community of developers out there. Add the github link to a source repo and tap into all that hardwork.

    When you add a new one, it will get stored in your settings file under 'sources'
    )
end

.sources_buildObject



55
56
# File 'lib/heydan/help_text.rb', line 55

def sources_build
end

.sources_newObject



58
59
# File 'lib/heydan/help_text.rb', line 58

def sources_new
end

.sources_syncObject



41
42
43
44
45
46
# File 'lib/heydan/help_text.rb', line 41

def sources_sync
  return if !HeyDan.help?
  puts %Q(
    Sync all the sources in your settings file.
    )
end

.sources_updateObject



48
49
50
51
52
53
# File 'lib/heydan/help_text.rb', line 48

def sources_update
  return if !HeyDan.help?
  puts %Q(
    Update a single source.
    )
end