Git Product home page Git Product logo

apex's People

Contributors

bjro avatar bsanyi avatar c-rack avatar eitoball avatar lowks avatar mikepack avatar olgeni avatar qqwy avatar russmatney avatar steffkes avatar tbk145 avatar tomciopp avatar tverlaan avatar tyre avatar waisbrot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

apex's Issues

Allow it to compile under Elixir 0.15.0

Apex v0.2.0 currently throws compilation warnings and errors.

➜  dmr-watch git:(master) ✗ mix deps.compile
==> idna (compile)
==> apex
warning: the dependency apex requires Elixir "~> 0.14.0" but you are running on v0.15.0

== Compilation error on file lib/apex/format/color.ex ==
** (CompileError) lib/apex/format/color.ex:46: undefined function binary_to_atom/1
    (stdlib) lists.erl:1352: :lists.mapfoldl/3
    (stdlib) lists.erl:1353: :lists.mapfoldl/3
    (elixir) src/elixir.erl:170: :elixir.erl_eval/3

could not compile dependency apex, mix compile failed. You can recompile this dependency with `mix deps.compile apex` or update it with `mix deps.update apex`

Format for Reference

Hi,

Can you add this?

defimpl Apex.Format, for: Reference do
import Apex.Format.Utils

def format(data, options \ []) do
colorize(inspect(data), data, options) <> new_line
end
end

If you want a pull req, let me know, otherwise if you have time, can you add it?

Thanks
Ernie

Error when printing empty tupple

iex> Apex.ap {}
OR
iex> Apex.ap {1,2, {}}
** (ArgumentError) argument error
:erlang.hd([])
lib/apex/format/tuple.ex:15: Apex.Format.Tuple.do_format/2
lib/apex/format/seq.ex:23: Apex.Format.Seq.do_format/3
(elixir) lib/enum.ex:981: anonymous fn/3 in Enum.map/2
(elixir) lib/stream.ex:1155: anonymous fn/3 in Enumerable.Stream.reduce/3
(elixir) lib/stream.ex:761: anonymous fn/3 in Stream.with_index/1
(elixir) lib/enum.ex:2213: Enumerable.List.reduce/3
(elixir) lib/stream.ex:1175: Enumerable.Stream.do_each/4

AST confused for records

Passing Elixir AST (for instance, the output of quote) triggers the "Elixir record" behavior here.

Example:

iex(3)> ast = quote do
...(3)>   foo[1].bar
...(3)> end
{{:., [], [{{:., [], [Access, :get]}, [], [{:foo, [], Elixir}, 1]}, :bar]}, [],
 []}
iex(4)> Apex.ap(ast)
{
  [0] .{
    [0] []
    [1] [
      [0] {
        [0] .{
          [0] []
          [1] [
            [0] :Elixir.Access
            [1] :get
          ]
        }
        [1] []
        [2] [
          [0] foo{
            [0] []
            [1] :Elixir
          }
          [1] 1
        ]
      }
      [1] :bar
    ]
  }
  [1] []
  [2] []
}

Would a "no srsly I don't have records here" option make sense? Something like the numbers: false setting.

Make Apex the default inspector in IEx?

With pry and AwesomePrint, there is a way to make AwesomePrint the default inspector, so that just typing in an expression is equivalent to ap expression. I believe you just need to require AwesomePrint in the .pryrc and issue a AwesomePrint.pry! which does the magic.

Is there any way you'd consider looking into this for Apex? The one thing I miss the most about Ruby is the combination of pry and AwesomePrint --> IEx isn't nearly as nice, but having Apex built in would go a long way :)

Inspecting modules in Phoenix

How would I debug something like the following? I'm having trouble debugging controllers in Phoenix. This is just one example.

  adef submitted(conn, _params) do
    render(conn, "submitted.html")
  end

When I do Apex.submitted(conn, params) in the iex console, I get iex:6: undefined function conn/0. I had already imported the module itself.

Release tags

Hi,
Could you please add a git tag for the latest version? It would be quite useful for building FreeBSD ports.

Feature Request: shorthand for Apex.Format.format

I want to use Apex in my logging, as it makes maps a whole lot easier to read.

To log something in Elixir, one would use Logger.debug(string), or variants of it.

doing Logger.debug(Apex.ap(something)) will not work, as Apex.ap will actually print the formatted result of something to STDOUT, while something will be returned to the input of Logger.debug.

Now, Apex internally formats the string using Apex.Format.format. I would like a shorter version of that, so the log-statements do not become hard to read.

Is this a good idea?

Turn off array indices?

Hi there,

Great package, but I was wondering if it would be possible to get Apex to return without all the [i]- this for me makes it really hard to read! It would be great if we could pass an option to Apex.apto do this.

Colors should have no-color mode.

I sometimes launch iex in a CMD shell and there the colors do absolutely nothing, they even make it worse because CMD is happy to parse the codes without interpreting them.

Maybe an option inside the user's mix.exs file could address that? Say, enable_colors which is by default true but can be set to false if desired?

Compile warning

This seems like an important compile warning for apex:

warning: function List.unzip/1 is undefined or private
  lib/apex/awesome_def.ex:52

And indeed, there is no List.unzip function in the Elixir module list.

Support for MapSet

or maybe it can just be implemented by defimpl Apex.Format, for: Set either way, its too trivial to PR :)

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.