diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-07 14:38:32 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-07 14:38:32 +0100 |
commit | 069376278eebdc6d94af1a27596439cd154d564f (patch) | |
tree | 37ab63f67fb67620eab45a4a15863f6898da9605 /web/lib | |
parent | 9824e1ccb79a786ff011c6cbae999084e94fd984 (diff) | |
download | taginfo-069376278eebdc6d94af1a27596439cd154d564f.tar taginfo-069376278eebdc6d94af1a27596439cd154d564f.tar.gz |
Small code cleanups
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/api/v4/josm.rb | 2 | ||||
-rw-r--r-- | web/lib/api/v4/key.rb | 4 | ||||
-rw-r--r-- | web/lib/api/v4/search.rb | 3 | ||||
-rw-r--r-- | web/lib/api/v4/tag.rb | 2 |
4 files changed, 5 insertions, 6 deletions
diff --git a/web/lib/api/v4/josm.rb b/web/lib/api/v4/josm.rb index 3cd6e0d..babfa5f 100644 --- a/web/lib/api/v4/josm.rb +++ b/web/lib/api/v4/josm.rb @@ -37,7 +37,7 @@ class Taginfo < Sinatra::Base [:line_width, :INT, 'Line width (if line rule).'], [:icon, :STRING, 'Icon path (if icon rule).'] ]), - :example => { :style => 'standard', :page => 1, :rp => 10}, + :example => { :style => 'standard', :page => 1, :rp => 10 }, :ui => '/reports/josm_styles' }) do style = params[:style] diff --git a/web/lib/api/v4/key.rb b/web/lib/api/v4/key.rb index e61aa3f..7cc9532 100644 --- a/web/lib/api/v4/key.rb +++ b/web/lib/api/v4/key.rb @@ -122,7 +122,7 @@ class Taginfo < Sinatra::Base [:line_width, :INT, 'Line width (if line rule).'], [:icon, :STRING, 'Icon path (if icon rule).'] ]), - :example => { :style => 'standard', :key => 'highway', :page => 1, :rp => 10}, + :example => { :style => 'standard', :key => 'highway', :page => 1, :rp => 10 }, :ui => '/keys/highway#josm' }) do style = params[:style] @@ -180,7 +180,7 @@ class Taginfo < Sinatra::Base :values => row['values_' + type].to_i } end - end + end return { :total => 4, diff --git a/web/lib/api/v4/search.rb b/web/lib/api/v4/search.rb index f692672..cf8d5e1 100644 --- a/web/lib/api/v4/search.rb +++ b/web/lib/api/v4/search.rb @@ -64,9 +64,8 @@ class Taginfo < Sinatra::Base query = params[:query].downcase total = @db.count('wiki.words').condition("words LIKE ('%' || ? || '%')", query).get_first_value().to_i - sel = @db.select("SELECT key, value FROM wiki.words WHERE words LIKE ('%' || ? || '%')", query) - res = sel. + res = @db.select("SELECT key, value FROM wiki.words WHERE words LIKE ('%' || ? || '%')", query). order_by(@ap.sortname, @ap.sortorder) { |o| o.key o.value diff --git a/web/lib/api/v4/tag.rb b/web/lib/api/v4/tag.rb index 95e8a3e..50e26c7 100644 --- a/web/lib/api/v4/tag.rb +++ b/web/lib/api/v4/tag.rb @@ -101,7 +101,7 @@ class Taginfo < Sinatra::Base [:line_width, :INT, 'Line width (if line rule).'], [:icon, :STRING, 'Icon path (if icon rule).'] ]), - :example => { :style => 'standard', :key => 'highway', :value => 'residential', :page => 1, :rp => 10}, + :example => { :style => 'standard', :key => 'highway', :value => 'residential', :page => 1, :rp => 10 }, :ui => '/tags/highway=residential#josm' }) do style = params[:style] |