Giter VIP home page Giter VIP logo

Comments (5)

olivierlacan avatar olivierlacan commented on August 17, 2024 1

@travisjeffery I'm assuming you can enable request stubbing by passing:

Analytics.init({ stub: true, ... })

Correct? Any chance you could add a bit of documentation on Analytics#initialize?

It's a little odd that the setup process isn't documented in the README. I can submit a PR if you folks need some help getting that into shape.

from analytics-ruby.

travisjeffery avatar travisjeffery commented on August 17, 2024 1

@olivierlacan :stub is documented at the bottom of our dedicated docs page, which is linked on the readme. go here: https://segment.io/docs/libraries/ruby/ and scroll to the bottom. i'll add a section title for that bit, thanks for bringing this up. all the options are documented there.

stub's available in v2, which is namespaced and not a singleton. so you would do:

Analytics = Segment::Analytics.new(stub: true)

from analytics-ruby.

calvinfo avatar calvinfo commented on August 17, 2024

Yeah, that makes some sense. I definitely want to have more logging in the library everywhere which can be enabled, so big +1 on logging requests there, though I'm not sure if I'm sold on the DI route yet.

FWIW: what we do currently is set up a "development" project and then use a separate key for prod vs dev setups. We then look at requests going into the segment.io debugger when figuring out what is being sent.

@travisjeffery

from analytics-ruby.

travisjeffery avatar travisjeffery commented on August 17, 2024

ok you'll be able to stub requests when that's pushed, i'm not sold on di in ruby either. http://david.heinemeierhansson.com/2012/dependency-injection-is-not-a-virtue.html

from analytics-ruby.

mikz avatar mikz commented on August 17, 2024

Thanks! I'm not going to argue about DI or not even though it would add more extensibility.
This solves testing/dev mode issue so thank you very much!

from analytics-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.