Questions tagged [addressable-gem]
13 questions
5
votes
1 answer
display IDNs from normalized URIs with ruby (using the Addressable Gem)
In my Ruby app I need to handle URIs from user input (which are actually IRIs)
str = "http://उदाहरण.परीक्षा/मुख्य_पृष्ठ"
I normalize these using Addressable, and only store the normalized form:
normalized =…

levinalex
- 5,889
- 2
- 34
- 48
3
votes
1 answer
addressable/uri gives params in alphabetical order in ruby
addressable/uri gives params in alphabetic order. If I want to get the query params as in the hash(i.e nonce, method, rate, order_type, quantity) how should I change my code?
2.1.0 :060 > require "addressable/uri"
2.1.0 :061 > uri =…

Sam
- 5,040
- 12
- 43
- 95
3
votes
1 answer
Get back full URI from Addressable object?
If I have an addressable object like this:
uri = Addressable::URI.parse("http://example.com/path/to/resource/")
How would I get back the "http://example.com/path/to/resource/" - I have looked at uri.methods, but I fail to see which one would I use…

Hommer Smith
- 26,772
- 56
- 167
- 296
2
votes
1 answer
How to have URI template with optional variable with path
I am using site prism to create an page object that has a possible 2 urls.
Site_prism uses Addressable::Template, and this uses the URI template RFC 6570.
The required page contains a list of elements, but can have none as well, and from this logic…

Ben_Slaughter
- 256
- 3
- 10
2
votes
2 answers
Unable to load gem after its installation
How to use an external library in Ruby?
I just installed Addressable library as stated in the documentation and write the following code:
require 'addressable/uri'
and it still…

FrozenHeart
- 19,844
- 33
- 126
- 242
2
votes
1 answer
Getting uninitialized constant error from unused gem
I was trying to use the Addressable gem in a specific action in Rails.
My usual practice is to include the gem in the Gemfile, and then require the module where needed.
Gemfile:
gem 'addressable'
some_controller.rb:
class SomeController <…

Yarin
- 173,523
- 149
- 402
- 512
2
votes
1 answer
Ruby Sesame method calling
Some public methods are working like count() and some I get "freeze" error
gem 'rdf', '=0.3.11.1'
require 'rdf'
require 'rdf/sesame'
require 'rdf/ntriples'
url = RDF::URI("http://localhost:8080/openrdf-sesame")
conn =…

rochbenritter
- 171
- 11
1
vote
1 answer
How to correctly use the Site-prism URL expansion
I have a page object with the following setup:
class StudynoteShowPage < SitePrism::Page
set_url "/studynotes{/studynote}"
end
When I use that page
ssp = StudynoteShowPage.new
ssp.load(studynote: @s1)
I get
ArgumentError:
wrong number of…

andreheijstek
- 71
- 1
- 9
0
votes
1 answer
rexml and addressable security vulnerabilities in Flutter
I have a Flutter project currently in production, and I have seen a while ago two security vulnerabilities pop up in dependabot, see below:
I am not really acquainted with native code, so am unsure on how to fix these dependencies.
Apart from…

Guillaume Ferron
- 306
- 2
- 8
0
votes
3 answers
Passing attributes in test url - Rspec / Addressable gem
From a View file I pass attributes in a url:
%= link_to piece_path(@current_piece, file: file, rank: rank), method: :patch do %>
this gives urls like http://localhost:3030/pieces/%23?file=8&rank=8
I need to extract the value of file and rank from…

Claire D
- 31
- 6
0
votes
1 answer
Unable to run rails commands due to invalid URI
Whenever I try to run foreman run rails server I receive the following error message from rails:
Absolute URI missing hierarchical segment: 'http://:9200' (Addressable::URI::InvalidURIError).
I realize that 'http://:9200' is an invalid URL, but part…

RyanQuey
- 705
- 1
- 9
- 29
0
votes
2 answers
Cannot install Ruby Gem Addressable v2.4.0
I am having problems with Ruby. When I try to install addressable, I get told I need ruby 1.9.0 or higher, but as you can see from my rvm list command I run 2.3.1.
Does anyone have any tips? am I doing something wrong? I've tried running the clean…

Kevin Gordon
- 33
- 3
0
votes
1 answer
Passing a list of same parameters with a different value
So basically I was creating some client methods that would create a path to hit an external service.
Also, I am using addressable gem.
Here is an example:
def get_member(ord_id, member_id)
path = '/organizations/{ord_id}/people/{member_id}'
hash…

Micheal
- 2,272
- 10
- 49
- 93